Image coding and decoding apparatus, method of image coding and decoding, and recording medium for recording program for image coding and decoding

ABSTRACT

In an image decoding apparatus that generates a decoded image from a code sequence. The decoding apparatus has a bus, a computer and a memory, wherein the computer and the memory are connected to each other via the bus. The code sequence is generated by performing orthogonal transform, quantization and entropy coding on image data, which is stored in the memory. The decoding apparatus includes an entropy decoding unit, achieved by the computer, for reading one code out of the code sequence, which is stored in the memory, via the bus and performing entropy decoding on the read code in to generate a decode value. The apparatus also includes a coefficient generating unit, achieved by the computer, for generating at least one orthogonal transform coefficient according to the generated decode value. Also, a writing unit is achieved by the computer, for writing the generated at least one orthogonal transform coefficient into the memory via the bus. A decode controlling unit and the writing unit is provided for instructing the entropy decoding unit to process a next code out of the code sequence.

BACKGROUND OF THE INVENTION

[0001] (1) Field of the Invention

[0002] The present invention relates to an apparatus and a method for an orthogonal transform, a quantization, and an entropy coding of images and a medium recording a program for these coding processes, and relates to an apparatus and a method for an inverse transform and the decoding of a compressed code sequence which is obtained after the orthogonal transform, quantization, and entropy coding, and a recoding medium for recording a program for these decoding processes.

[0003] (2) Description of the Related Art

[0004] In recent years, techniques for decoding images which have been coded and compressed with high efficiency have been extensively developed and used in various fields, such as computers, communications, and broadcasts. Joint Photographic Coding Experts Group (JPEG) is recommended as an international standard for the compression coding and expansion decoding of images and Moving Picture Experts Group 1 (MPEG 1) Video is recommended as an international standard for the decoding of movies.

[0005] With these methods, image information is divided into blocks, each of which is composed of a certain number of pixels. Each pixel in the blocks is subjected to the orthogonal transform, quantization, and entropy coding to generate codes (or sometimes referred to as Huffman codes). The generated codes are combined and, construct a compression code sequence (or referred to simply as a code sequence). Codes in the compression code sequence are subjected to the entropy decoding, dequantization, and inverse orthogonal transform to generate an original image.

[0006] It should be noted here that, in the following description, the process for subjecting each pixel to the orthogonal transform, quantization, and entropy coding is referred to as a compression coding (or referred to simply as a coding) to be distinguished from the entropy coding. Also, the process for subjecting codes to the entropy decoding, dequantization, and inverse transform is referred to as an expansion decoding (or referred to simply as a decoding) to be distinguished from the entropy decoding.

[0007] 1. Operation for Compression Coding and Decoding

[0008] The following is a description of the operation for the compression coding and the expansion decoding which is base on the baseline method which is essential to an image coding apparatus and an image decoding apparatus supporting Discrete Cosine Transform (DCT) of JPEG. The following description uses an example where each of an image coding apparatus and an image decoding apparatus includes a general-purpose microcomputer.

[0009] 1.1 Procedure for Compression Coding

[0010] (1) Outline of Operation Procedure for Compression Coding

[0011] The following is a description of the operation procedure for the compression coding, with reference to the drawings.

[0012]FIG. 1 is a flowchart showing the outline of the operation procedure for the compression coding which is based on the JPEG baseline method.

[0013] Initialization for coding control is performed and one or more marker codes prescribed by JPEG are outputted (Step S1901). A rectangular area called a block composed of 8×8 pixels is cut out of an image to be compressed and coded (Step S1902), each element in the cut-out block is subjected to the discrete cosine transform, namely one type of the orthogonal transform, DCT coefficients of 8 lines×8 columns are outputted (Step S1903), the outputted DCT coefficients are divided by their corresponding elements in a quantization table, and 64 quantized DCT coefficients are outputted (Step S1904). The process for dividing each DCT coefficient by its corresponding element in the quantization table is called a quantization. The quantized DCT coefficients are scanned in the order called a zigzag scan and are subjected to the entropy coding, namely one type of the transform coding, to output a compression code sequence in which an image is compressed (Step S1905). Whether this process is repeated for all blocks of the image to be compressed and coded is confirmed (Step S1906). If all blocks of the image have been subjected to this process, the compression coding process is completed; if not, the operation returns to Step S1902 and this process is commenced for the next block.

[0014] (2) Operation Procedure for Quantization

[0015] The following is a description of the operation procedure in the quantization step shown in FIG. 1 as Step S1904, with reference to the flowchart shown in FIG. 2.

[0016] The loop counter “i” for controlling the repetition of the quantization process is initialized to be set to the value “0” (Step S1911). A DCT coefficient S(i) and an element Q(i) in the quantization table, which each correspond to the value of the loop counter “i”, are loaded from the memory (Steps S1912 and S1913), S(i) is divided by Q(i), the division result is rounded to be normalized so that a quantized DCT coefficient Sq(i) is obtained (Step S1914), and the quantized DCT coefficient Sq(i) is stored in a memory (Step S1915). The loop counter “i” is incremented by one to quantize the next DCT coefficient (Step S1916), and whether all DCT coefficients in one block have been subjected to this process is confirmed using the value of the loop counter “i” (Step, S1917). If all DCT coefficients in one block have been subjected to this process, this quantization process is completed; if not, the operation returns to Step S1912 and remaining DCT coefficients are subjected to this quantization process.

[0017] (3) Operation Procedure for Entropy Coding

[0018] The following is a description of the operation procedure in the entropy coding step shown in FIG. 1 as Step S1905, with reference to the flowchart in FIG. 3.

[0019] A Sq(0), namely the quantized DCT coefficient of a DC component, is loaded from the memory and the DC component Sq(0) is subjected to the entropy coding (Steps S1921 and S1922). A loop counter “i” for controlling the repetition of the entropy coding process on the quantized DCT coefficients of AC components and a counter “nnnn” for counting each zero coefficient run are initialized to be set to the values “1” and “0,” respectively (Step S1923). A scan order “z” corresponding to the loop counter “i” is obtained using a zigzag function “Zig( )” for generating a scan order used to perform a zigzag scan on quantized DCT coefficients (Step S1924). Using the scan order “z,” a quantized DCT coefficient Sq(z) of an AC component is loaded from the memory (Step S1925) and whether the value of this loaded quantized DCT coefficient Sq(z) is zero is judged (Step S1926). If the value of the quantized DCT coefficient Sq(z) is zero, the zero coefficient run counter “nnnn” is incremented by one (Step S1931); if not, the value of the zero coefficient run counter “nnnn” and the quantized DCT coefficient Sq(z) are combined and subjected to the entropy coding (Step S1927), and the zero coefficient run counter “nnnn” is initialized to be set to the value “0” (Step S1928). The loop counter “i” is incremented by one (Step S1929) and whether this process has been performed on one block is judged using the value of the loop counter “i” (Step S1930). If this process has been performed on one block, the entropy coding is completed; if not, the operation returns to Step S1924 to continue this entropy coding.

[0020] 1.2 Procedure for Expansion Decoding

[0021] To use compressed and coded images, these images need to be subjected to the expansion decoding. The following is a description of the procedure for the expansion decoding, with reference to the drawings.

[0022] (1) Outline of Operation Procedure for Expansion Decoding

[0023]FIG. 4 is a flowchart showing the outline of the expansion decoding which is based on the JPEG baseline method.

[0024] Initialization for control of expansion decoding is performed and each marker code included in a compression code sequence is analyzed (Step S1941). The compression code sequence is subjected to the entropy decoding, namely one type of the transform coding, and 64 quantized DCT coefficients corresponding to one block are obtained (Step S1942). The obtained quantized DCT coefficients are multiplied by their corresponding elements in a quantization table to obtain DCT coefficients corresponding to one block (Step S1943). The obtained DCT coefficients corresponding to one block are subjected to the inverse discrete cosine transform (Step S1944), an original image in one block is restored, the restored original image in one block is outputted to the memory storing decoded images in respective blocks, and a full-size original image is reconstructed (Step S1945). Whether this process has been performed on all blocks is confirmed (Step S1946). If this process has been performed on all blocks, this expansion decoding process is completed; if not, the process from the entropy coding to the image reconfiguration (Steps S1942 to S1945) is repeated on remaining blocks.

[0025] (2) Operation Procedure for Entropy Decoding

[0026] The following is a description of the entropy decoding step shown in FIG. 4 as Step S1942, with reference to the flowchart in FIG. 5.

[0027] One code in a compression code sequence in which an image is compressed is subjected to the entropy decoding to obtain the quantized DCT coefficient Sq(0) of a DC component (Step S1961), and the DC component Sq(0) is stored in a memory (Step S1962). A loop counter “i” for controlling the entropy decoding on the quantized DCT coefficients of AC components is initialized to be set to the value “1” (Step S1963). The next code in the compression code sequence is subjected to the entropy decoding and the value of a zero run length “nnnn” and the quantized DCT coefficient of an AC component are obtained (Step S1964). An index “Z” which is used for a zigzag scan and corresponds to the loop counter “i” is obtained using a zigzag function Zig(i) (Step S1965) and the loop counter “i” is incremented by one (Step S1966). Whether the zero run length “nnnn” is zero is confirmed (Step S1967). If the zero run length “nnnn” is not zero, a value “0” is set as the quantized DCT coefficient Sq(z) of an AC component (Step S1970), Sq(z) having the value “0” is stored in the memory (Step S1971), the zero run length “nnnn” is decremented by one (Step S1972), and the process flow returns to Step S1965. If the zero run length “nnnn” is zero, the AC component Sq(z) is stored in the memory (Step S1968) and whether one block has been subjected to this process is confirmed using the value of the loop counter “i” (Step S1969). If the value of the loop counter “i” is 64, the process is judged to have been performed on one block and this entropy decoding process is completed; if not, the process is not judged to have been performed on one block, and the operation returns to Step S1964 to continue the entropy decoding.

[0028] (3) Operation Procedure for Dequantization

[0029] The following description concerns the operation procedure in the dequantization step shown in FIG. 4 as Step S1943, with reference to the flowchart in FIG. 6.

[0030] A loop counter “i” for controlling the repetition of the dequantization process is initialized to be set to the value “0” (Step S1951). A quantized DCT coefficient Sq(i) and an element Q(i) in the quantization table, which each correspond to the value of the loop counter “i”, are loaded from the memory (Steps S1952 and S1953), the quantized DCT coefficient Sq(i) is subjected to the dequantization using S(i)=Sq(i)×Q(i) to calculate a DCT coefficient S(i) (Step S1954), and the DCT coefficient S(i) is stored in the memory (Step S1955). The loop counter “i” is incremented by one to perform the dequantization on the next quantized DCT coefficient (Step S1956) and whether one block has been subjected to this process is confirmed using the value of the loop counter “i” (Step S1957). If the value of the loop counter “i” is 64, this process is judged to have been performed on one block and the dequantization process is completed; if not, this process is not judged to have been performed on one block and the process flow returns to Step S1952 to continue this dequantization process.

[0031] 1.3 Order of Zigzag Scan

[0032]FIG. 7 shows the order of a zigzag scan during the process of the entropy coding and entropy decoding. In this figure, 64 circles represent quantized DCT coefficients or DCT coefficients. The white circle represents a DC component and 63 black circles represent AC components (AC1 to AC63). The numbers attached to the lower right of the circles and arrows show the order of the zigzag scan. The zigzag scan is repeated in the order of right, lower left, under, upper right, and then right.

[0033]FIG. 8 is a table showing the relation between the element number “i” of a quantized DCT coefficient or a DCT coefficient and the zigzag function Zig(i) which gives an order of the zigzag scan and corresponds to the element number “i”.

[0034] With the process procedure described above, an image is compressed and coded with efficiency, and a compression code sequence representing a compressed and coded image is expanded and decoded.

[0035] 2. Entropy Decoding Process

[0036] The following is a detailed description of the entropy decoding of a code in Steps S1961 and S1964 in the flowchart of the entropy decoding process shown in FIG. 5.

[0037] Each code is made up of a bit sequence including two types of bits “0” and “1” and corresponds to one decode value. The structure of the bit sequence making up a code is determined by the fixed length code method or the variable length code method. With the fixed length code method, all codes have the same code length; with the variable length code method, each code has different code length.

[0038] Note that in the following description, codes have variable length, if not otherwise stated.

[0039] In the case of the variable length code method, on the assumption that the code length of a code having the longest code length is one word, address spaces each of which is 2 raised to the word length power are prepared in a conventional code sequence entropy decoding apparatus. The conventional code sequence entropy decoding apparatus is provided with a decode table. The decoding table is searched using a bit sequence as long as one word starting from the entropy decoding start position to obtain a corresponding decode value. With this method, the entropy decoding can be performed at high speed. However, as the longest code sequence length becomes longer, the size of the decode table becomes larger. As a result, there is a problem that more memory capacity is required, which increases the cost of the apparatus.

[0040] To solve this problem, Japanese Laid-Open Patent Application No. 6-44039 discloses an apparatus where the size of the decode table is reduced. The following description concerns the principle of the entropy decoding, the structure of the decode table, and the procedure for the entropy decoding, which are disclosed in Japanese Laid-Open Patent Application No. 6-44039.

[0041] 2.1 Principle of Entropy Decoding

[0042] The following is a description of the principle of the entropy decoding disclosed in Japanese Laid-Open Patent Application No. 6-44039. As can be seen from FIG. 9, a plurality of variable length codes are divided into groups, where each group includes codes having the same run. Here, the run is a sequence of same bits from the start of each variable length code. With regard to all variable length codes 2087 whose run lengths are “6,” each 2-bit sequence following the run is the same bit sequence “11” (this same bit sequence will be hereinafter referred to as an identical bit sequence). As shown in the figure, each variable length code 2087 in the group of the run length “6” has a unique part which follows the run and the identical bit sequence (this unique part will be hereinafter referred to as an evaluation bit pattern) Therefore, this evaluation bit pattern represents its corresponding variable length code in the group of the run length “6.” This principle can be applied to other groups of the run lengths which are not “6.”

[0043] As described above, because a set of a run length, the length of an identical bit, and an evaluation bit pattern represents a certain variable length code, a decoding table can be made using this characteristic.

[0044] It should be noted here that the group of the run length “4” in FIG. 9 includes variable length codes of different lengths. The setting manner of the evaluation bit patterns in this group is described later.

[0045] 2.2 Structure of Decoding Table

[0046] The following is a description of the structure of the decoding table which is based on the above-mentioned entropy decoding principle. As shown in FIG. 10, the decoding table is composed of the primary decoding table 2300 and the secondary decoding table 2310.

[0047] The primary decoding table 2300 is a two-dimensional data table storing a plurality of sets which are each composed of a shift amount 2302, an evaluation bit pattern length 2303, and an offset 2304. Each run length 2301 is a bit length of a run and is also used as an address specifying one of the plurality of sets in a line of the primary decoding table 2300. Each shift amount 2302 is a run length plus a length of an identical bit sequence. Each evaluation bit pattern length 2303 gives a bit length of an evaluation bit pattern. Each offset 2304 gives a value related to the addressing in the secondary decoding table 2310 described later. Each addition value calculated by adding an offset 2304 to an evaluation bit pattern is an address specifying a decode value in a line of the secondary decoding table 2310.

[0048] The secondary decoding table 2310 is a two-dimensional table storing pairs of a decode value 2314 and a code length 2315. Each address 2311 is an addition value obtained by adding an offset 2304 to an evaluation bit pattern and is also used as an address specifying a decode value 2314 in a line of the secondary decoding table 2310. Each decode value 2314 corresponds to a variable length code and is obtained by performing the entropy decoding on the variable length code. Each code length 2315 is a bit length of a variable length code.

[0049] In the case of quantized DCT coefficients of AC components of JPEG, each decode value 2314 is made up of two values, that is, a zero run length and a non-zero coefficient value.

[0050] 2.3 Procedure for Entropy Decoding

[0051] The following description concerns the procedure for the entropy decoding of variable length codes using the primary decoding table 2300 and the second decoding table 2310 shown in FIG. 10. The entropy decoding is the transformation of a code extracted from a code sequence into its corresponding decode value. In this description, the variable length code “0000 0011 011” 2086 is extracted from the code sequence of “0000 0011 011 . . . . ” and is subjected to the entropy decoding.

[0052] Because the run length of the variable length code 2086 is “6,” the primary decoding table 2300 is searched using this run length “6” as an address to obtain its corresponding values, that is, the shift amount “8” 2302, the evaluation bit pattern “3” 2303, and the offset “A6” 2304. Because the shift amount is “8,” the head bit position of the evaluation bit pattern 2085 is detected at the position where the variable length code 2086 is shifted to the left by 8 bits from its head bit. Because the evaluation bit pattern length is “3,” the evaluation bit pattern 2085 is determined to be “011.” The determined evaluation bit pattern “011” 2085 is added to the offset “A6” to obtain the corresponding address in the secondary decoding table. The secondary decoding table 2310 is searched using the obtained address and the decode value “10” 2314 is obtained.

[0053]FIGS. 11 and 28 show respectively the primary decoding table and the secondary decoding table for the decoding apparatus disclosed in Japanese Laid-Open Patent Application No. 6-44039. Because the bit width of the shift amount column is 4 bits, the bit width of the evaluation bit pattern column is 4 bits, the bit width of the offset column is 8 bits, and there are seven types of runs, the size of the primary decoding table is 112 bits calculated from (4 bits+4 bits+8 bits)×7 types. It should be noted here that each run length is an address value in the primary decoding table so that the run length column is not included in the size of this table. Because the bit width of the decode value column is 8 bits, the bit width of the code length column is 4 bits, and there are 55 types of decode values, the size of the secondary decoding table is 660 bits calculated from (8 bits+4 bits)×55 types.

[0054] 3. Problems in the Conventional Techniques

[0055] As described above, an original image is compressed and coded with high efficiency to obtain a compression code sequence, and the compression code sequence is decoded to generate the original image.

[0056] However, this image processing for the image compression coding and image decoding needs a very large amount of operations, so that a general-purpose microcomputer will require a long time for this image processing. This is because a large number of memory load and store operations need to be performed due to the very large amount of data of an image, and because many operations which require a long processing time are used in this image processing.

[0057] This processing time is conventionally shortened by replacing a general-purpose microcomputer with special hardware or a digital signal processor. However, these devices are high-priced, resulting in the increased cost of products.

SUMMARY OF THE INVENTION

[0058] The object of the present invention is to shorten the processing time during the image compression and image decoding, and in particular to improve the image processing time performance of an apparatus which uses a general-purpose microcomputer to process an image.

[0059] The object above is achieved by an image coding apparatus which codes image information, the apparatus including: a storage means for storing a plurality of orthogonal transform coefficients corresponding to a block, the block being a part of the image information; a reading means for reading an orthogonal transform coefficient from the storage means, the orthogonal transform coefficient being specified by a coding control means; a quantization means for performing quantization on the orthogonal transform coefficient read by the reading means to generate a first coefficient; an entropy coding means for performing entropy coding according to the generated first coefficient; and the coding control means for, after the read orthogonal transform coefficient is processed by the quantization means and the entropy coding means, specifying a next orthogonal transform coefficient to be read by the reading means.

[0060] With this structure, the quantization is also performed in the entropy coding step so that the storing of quantized DCT coefficients, the loop control, and the loading of quantized DCT coefficients can be omitted, which are necessary for a conventional image coding apparatus. As a result, the processing time during the image coding is shortened.

[0061] The object above is also achieved by an image decoding apparatus which generates a decoded image from an inputted code sequence, where the code sequence is generated by performing orthogonal transform, quantization, and entropy coding on image data, the apparatus including: an entropy decoding means for reading one code out of the code sequence and performing entropy decoding on the read code to generate a decode value; a coefficient generating means for generating at least one orthogonal transform coefficient according to the generated decode value; a storage means for storing the generated at least one orthogonal transform coefficient; and a decode controlling means for, after processes of the coefficient generating means and the storage means, instructing the entropy decoding means to read a next code out of the code sequence.

[0062] With this structure, the entropy decoding and dequantization are successively performed on each code so that the storing of quantized DCT coefficients, the loading of quantized DCT coefficients, and the loop control can be omitted, which are necessary for a conventional image coding apparatus. As a result, the processing time during the image decoding is shortened.

BRIEF DESCRIPTION OF THE DRAWINGS

[0063] These and the other objects, advantages and features of the invention will become apparent from the following description thereof taken in conjunction with the accompanying drawings which illustrate a specific embodiment of the invention. In the drawings:

[0064]FIG. 1 is a flowchart showing the outline of the coding procedure of a conventional image coding apparatus;

[0065]FIG. 2 is a flowchart showing the quantization step in the coding procedure of the conventional image coding apparatus;

[0066]FIG. 3 is a flowchart showing the entropy coding step in the coding procedure of the conventional image coding apparatus;

[0067]FIG. 4 is a flowchart showing the outline of the expansion decoding procedure of a conventional image decoding apparatus;

[0068]FIG. 5 is a flowchart showing the entropy decoding step in the expansion decoding procedure of the conventional image decoding apparatus;

[0069]FIG. 6 is a flowchart showing the dequantization step in the expansion decoding procedure of the conventional image decoding apparatus;

[0070]FIG. 7 shows the order of a zigzag scan on DCT coefficients and quantized DCT coefficients;

[0071]FIG. 8 shows the structure of the zigzag function Zig( ) showing the order of the zigzag scan;

[0072]FIG. 9 shows the principle of the conventional entropy decoding of variable length codes;

[0073]FIG. 10 shows conventional decoding tables used to perform the entropy decoding on variable length codes and the outline of the entropy decoding process;

[0074]FIG. 11 shows an example of the conventional primary decoding table of variable length codes;

[0075]FIG. 12 is the block diagram of a digital still camera of an embodiment of the present invention;

[0076]FIG. 13 is a flowchart showing the outline of the compression coding procedure of the digital still camera shown in FIG. 12;

[0077]FIG. 14 is a flowchart showing the quantization and entropy coding step in the compression coding procedure of the digital still camera shown in FIG. 12;

[0078]FIG. 15 shows an example of DCT coefficients of the digital still camera shown in FIG. 12;

[0079]FIG. 16 shows an example of the quantization table used for the digital still camera shown in FIG. 12;

[0080]FIG. 17 is a flowchart showing the outline of the expansion decoding procedure of the digital still camera shown in FIG. 12;

[0081]FIG. 18 is a flowchart showing the entropy decoding and dequantization step in the expansion decoding procedure of the digital still camera shown in FIG. 12;

[0082]FIG. 19 shows an example of quantized DCT coefficients of the digital still camera shown in FIG. 12;

[0083]FIG. 20 shows an example of DCT coefficients obtained by performing the dequantization on the quantized DCT coefficients of the digital still camera shown in FIG. 12;

[0084]FIG. 21 shows the principle of the entropy decoding of the digital still camera shown in FIG. 12;

[0085]FIG. 22 shows the principle of the entropy decoding of the digital still camera shown in FIG. 12;

[0086]FIG. 23 shows the decoding tables and the outline of the entropy decoding process of the digital still camera shown in FIG. 12;

[0087]FIG. 24 is a functional block diagram of the entropy decoding process of the digital still camera shown in FIG. 12;

[0088]FIG. 25 is a flowchart showing the entropy decoding procedure for the digital still camera shown in FIG. 12;

[0089]FIG. 26 is a flowchart showing the procedure for detecting runs of the digital still camera shown in FIG. 12;

[0090]FIG. 27 shows an example of the primary decoding table of the digital still camera shown in FIG. 12;

[0091]FIG. 28 shows an example of the secondary decoding table of the digital still camera shown in FIG. 12;

[0092]FIG. 29 is a block diagram of the entropy decoding circuit of the digital still camera shown in FIG. 12 of another embodiment;

[0093]FIG. 30 shows the principle of the entropy decoding process of the digital still camera shown in FIG. 12 of the other embodiment;

[0094]FIG. 31 shows the structure of decoding tables and the outline of the entropy decoding process of the digital still camera shown in FIG. 12 of the other embodiment;

[0095]FIG. 32 is a flowchart showing the procedure for the entropy decoding process shown in FIG. 31;

[0096]FIG. 33 shows the structure of coding tables and the outline of the entropy coding process of the digital still camera shown in FIG. 12 of the other embodiment;

[0097]FIG. 34 is a flowchart showing the procedure for the entropy coding process shown in FIG. 33;

[0098]FIG. 35 shows an example of the coding table used for a conventional entropy coding process; and

[0099]FIG. 36 shows an example of the coding table used for the entropy coding process shown in FIG. 33.

DESCRIPTION OF THE PREFERRED EMBODIMENT

[0100] 1. Embodiment 1

[0101]FIG. 12 is a block diagram of the digital still camera of an embodiment of the present invention. The digital still camera in this figure includes: the microcomputer 1119 for controlling the camera and for performing the compression coding and the expansion decoding on images; the image photographing unit 1120 for converting images into electric signals using a CCD; the memory 1121 for temporarily storing information of photographed images to perform the compression coding and the expansion decoding on the images, the memory 1121 including a RAM used for the operation of the microcomputer 1119 and a ROM for storing a control program for controlling the microcomputer 1119; the memory card 1122 for storing data of compressed images (compression code sequence) obtained after the photographed images are subjected to the compression coding; and the liquid crystal display unit 1123 for displaying the photographed images.

[0102] 1.1 Procedure for Compression Coding of Image

[0103] The following is a description of the operation procedure for the compression coding which is based on the JPEG baseline method, and this description mainly concerns differences between this embodiment and the conventional technique.

[0104] (1) Outline of Operation Procedure for Compression Coding

[0105]FIG. 13 is a flowchart showing the outline of the operation procedure for the compression coding of the digital still camera shown in FIG. 12. The following description mainly concerns differences between this flowchart and that shown in FIG. 1. Note that the following operation is performed by the microcomputer 1119.

[0106] In the digital still camera shown in FIG. 12, DCT coefficients are obtained by subjecting each block to the discrete cosine transform on a block-by-block basis. Each element corresponding to one block is subjected to the quantization and successively to the entropy coding on an element-by-element basis (Step S1104). Other steps, that is, Steps S1101, S1102, S1103, and S1105 are the same as Steps S1901, S1902, S1903, and S1906 shown in FIG. 1, respectively, and therefore are not described here.

[0107] (2) Operation Procedure for Quantization and Entropy Coding

[0108] The following is a description of the differences between the operation procedure for the quantization and entropy coding step in the compression coding operation of the digital still camera shown in FIG. 12 and the conventional technique, with reference to the flowchart shown in FIG. 14. Note that the operation described below is performed by the microcomputer 1119.

[0109] The DCT coefficient S(0) of a DC component is loaded from the memory (Step S1111), the element Q(0) in the quantization table is loaded from the memory (Step S1112), the quantized DCT coefficient Sq(0) of the DC element is calculated by quantizing the DCT coefficient S(0) using Sq(0)=round (S(0)/Q(0)) (Step S1113), and the quantized DCT coefficient Sq(0) is subjected to the entropy coding to generate a code value (Step S1114).

[0110] With regard to each of 63 DCT coefficients of AC components, the scan order “z” corresponding to the loop counter “i” is obtained using the zigzag function Zig( ) for generating a scan order used to perform a zigzag scan on the AC components (Step S1116). Using this scan order “z,” the DCT coefficient S(z) of an AC component is loaded from the memory (Step S1117) and its corresponding element Q(z) in the quantization table is loaded from the memory (Step S1118). The DCT coefficient S(z) is quantized using Sq(z)=round(S(z)/Q(z)) to calculate the quantized DCT coefficient Sq(z) (Step S1119). If the Sq(z) of a quantized AC component is not zero (Step S1120), values of the zero coefficient run counter “nnnn” and of the Sq(z) are subjected to the entropy coding to generate a code value (Step S1121) and the zero coefficient run counter “nnnn” is initialized to be set to the value “0” (Step S1122); if the Sq(z) of the quantized AC component is zero (Step S1120), the zero coefficient run counter “nnnn” is incremented by one (Step S1125).

[0111] The loop counter “i” is incremented by one (Step S1123). If the value of the loop counter “i” is 64, this process has been performed on one block; if not, the operation returns to Step S1116 to repeat the entropy coding process on remaining AC components in the block.

[0112] (3) Specific Embodiment of Quantization and Entropy Coding

[0113] The following description concerns the process procedure for the quantization and entropy coding described above using specific values of DCT coefficients. Note that the following operation is performed by the microcomputer 1119.

[0114]FIG. 15 shows an example of DCT coefficients. The DCT coefficients are calculated by performing the discrete cosine transform on each element composing a block cut out of an image to be compressed and coded. FIG. 16 shows an example of the quantization table composed of 64 elements of 8 elements×8 elements.

[0115] The DCT coefficients shown in FIG. 15 are subjected to the quantization and entropy coding using the quantization table shown in FIG. 16.

[0116] At first, a DCT coefficient is subjected to the quantization. As shown in FIG. 15, the DCT coefficient of the DC element is 123. As can be seen from FIG. 16, the value of its corresponding element in the quantization table is 16. Therefore, the quantized DCT coefficient Sq(0) “8” is obtained from “round (123/16).” This value is subjected to the entropy coding to generate a code value.

[0117] In FIG. 15, the DCT coefficient S(1) of the first AC element is “−4.” In FIG. 16, its corresponding element Q(1) in the quantization table is “11.” Therefore, the quantized DCT coefficient Sq(1) “0” is obtained from “round (−4/11).” In FIG. 15, the DCT coefficient S(2) of the second AC element is “3.” In FIG. 16, its corresponding element Q(2) in the quantization table is “12.” Therefore, the quantized DCT coefficient Sq(2) “0” is obtained from “round (3/12).” In FIG. 15, the DCT coefficient S(3) of the third AC element is “4.” In FIG. 16, its corresponding element Q(3) in the quantization table is “14.” Therefore, the quantized DCT coefficient Sq(3) “0” is obtained from “round (4/14).” In FIG. 15, the DCT coefficient S(4) of the fourth AC element is “−30.” In FIG. 16, its corresponding element Q(4) in the quantization table is “12.” Therefore, the quantized DCT coefficient Sq(4) “−3” is obtained from “round (−30/12).” In this state, the values of “0,” “0,” “0,” and “−3” are obtained as quantized DCT coefficients of AC elements. Therefore, a pair of the zero coefficient run length “3” and the quantized DCT coefficient “−3” is subjected to the entropy coding to generate a code and the generated code is outputted.

[0118] In the same manner, the quantization and entropy coding are repeated on all remaining elements shown in FIG. 15 so that the entropy coding is performed on one block of the image and codes corresponding to the block are outputted.

[0119] (4) Conclusion

[0120] As described above, the quantization is also performed in the entropy coding step. As a result, in the present invention, the storing of quantized DCT coefficients and the loop control, namely Steps S1915, S1916, and S1917 in FIG. 2 showing the conventional image compression coding method, can be omitted. Also, the loading of the quantized DCT coefficients, namely Steps S1921 and S1925 in FIG. 3, can be omitted.

[0121] In the present invention, if the Sq(z), namely the value of a quantized AC coefficient, is zero (Step S1120), the zero coefficient run counter “nnnn” is incremented by one. In this case, the storing of quantized DCT coefficients and the loop control, namely Steps S1915, S1916, and S1917 in FIG. 2 showing the conventional image compression coding method can be omitted. Also, the loading of the quantized DCT coefficient Sq(z), namely Step S1925 in FIG. 3, can be omitted.

[0122] In the case of JPEG, if all remaining AC components are zero during the compression coding, the last non-zero AC component in a target block is coded and an “EOP” code is outputted which shows that all remaining AC components are “0.” If the zero run of AC components is “16” or more, a “ZRL” code is outputted which shows that value of the zero run is “16.”

[0123] Another embodiment may be a recording medium which can be read by a computer and includes a coding program of the above coding method executed by the computer. Also, the coding program may be transmitted via a telecommunication line.

[0124] 1.2 Procedure for Expansion Decoding

[0125] The following is a description of the operation procedure for the expansion decoding by the digital still camera shown in FIG. 12 which is base on the JPEG baseline method, and this description mainly concerns differences between this embodiment and the conventional technique.

[0126] (1) Outline of Operation Procedure for Expansion Decoding

[0127]FIG. 17 is a flowchart showing the outline of the operation procedure for the expansion decoding by the digital still camera shown in FIG. 12. Note that the following operation is performed by the microcomputer 1119 and the following description mainly concerns differences between this flowchart and that shown in FIG. 4.

[0128] In the digital still camera shown in FIG. 12, each code to be decoded is subjected to the entropy decoding and successively to the dequantization on a code-by-code basis (Step S1132). This operation is repeated on all codes corresponding to one block to generate DCT coefficients corresponding to the block. Other steps are the same as those shown in FIG. 4, and therefore are not described here.

[0129] (2) operation Procedure for Entropy Decoding and Dequantization

[0130] The following is a description of the differences between the expansion decoding operation of the digital still camera shown in FIG. 12 and the conventional technique, with reference to the flowchart in FIG. 18. Note that the following operation is performed by the microcomputer 1119.

[0131] One code out of a compression code sequence in which an image is compressed is decoded to generate the quantized DCT coefficient Sq(0) of a DC component (Step S1141), the element Q(0) in the quantization table is loaded from the memory (Step S1142), the DCT coefficient S(0) of the DC component is generated using S(0)=Sq(0)×Q(0) (Step S1143), and the generated DCT coefficient S(0) is stored in the memory (Step S1144).

[0132] With regard to each of 63 DCT coefficients of AC components, one code out of the compression code sequence in which an image is compressed is decoded, the value of the zero coefficient run “nnnn” and the quantized DCT coefficient of an AC component are generated (Step S1146), the scan order “z” corresponding to the loop counter “i” is obtained using the zigzag function Zig( ) for generating a scan order used to perform a zigzag scan on the AC components (Step S1147), the value of the loop counter is incremented by one (Step S1148), and whether the value of the zero coefficient run “nnnn” is zero is confirmed. If the zero coefficient run “nnnn” is zero (Step S1149), a corresponding component Q(z) in the quantization table is loaded from the memory (Step S1150), the DCT coefficient S(z) of the AC component is calculated using S(z)=Sq(z)×zQ(z) (Step S1151), and the calculated DCT coefficient S(z) of the AC component is stored in the memory (Step S1152). Whether the value of the loop counter “i” is 64 is confirmed. If the value of the loop counter “i” is 64 (Step S1153), this process is completed; if not (Step S1153), the operation returns to Step S1146 and this process is performed on remaining AC components. If the value of the zero coefficient run “nnnn” is not zero (Step 1149), the DCT coefficient S(z) is set to zero (Step S1154), the DCT coefficient S(z) of the AC component set to zero is stored in the memory (Step S1155), the zero coefficient run “nnnn” is decremented by one, and the operation returns to Step S1147 to repeat this process on remaining AC components.

[0133] Note that if an “EOB” is detected as a result of the entropy decoding, “0s” of the number of remaining AC components are outputted as DCT coefficients. If a “ZRL” is detected, sixteen “0s” are outputted.

[0134] (3) Specific Embodiment of Entropy Decoding and Dequantization

[0135] The following is a description of the process procedure for the entropy decoding and dequantization using specific values. Note that the following operation is performed by the microcomputer 1119.

[0136] Quantized DCT coefficients in this description are assumed to be the values shown in FIG. 19. The following description concerns the operation for subjecting these values to the entropy decoding and dequantization using the quantization table shown in FIG. 16. FIG. 20 shows the DCT coefficients obtained after the entropy decoding and dequantization.

[0137] A code is subjected to the entropy decoding and a quantized DCT coefficiet “8” is obtained as shown in FIG. 19. As can be seen from FIG. 16, its corresponding element in the quatization table is “16” so that the DCT coefficient “128” shown in FIG. 20 is obtained by multiplying 8 by 16. The following code is subjected to the entropy decoding and the zero run length “3” and the quantized DCT coefficient “−43” are obtained. Because the zero run length is “3,” a “0” is outputted three times as shown in FIG. 20. With regard to the quantized DCT coefficient “−3,” its corresponding element “12” in the quantization table shown in FIG. 16 is loaded, its DCT coefficient is calculated by multiplying −3 by 12, and the value “−36” is outputted as shown in FIG. 20.

[0138] In this manner, the entropy decoding and dequantization are successively repeated. If an “EOB” code is detected, a “0” is outputted to each remaining DCT coefficients.

[0139] (4) Conclusion

[0140] As described above, the entropy decoding and dequantization are successively performed on each code. As a result, in the present embodiment, the storing of quantized DCT coefficients, namely Steps S1962, S1971, and S1968 in FIG. 5 showing a conventional image decoding operation, can be omitted. Also, the loading of quantized DCT coefficients and the loop control, namely Steps S1952, S1956, and S1957 in FIG. 6, can be omitted.

[0141] Furthermore, in the present embodiment, with regard to elements in the quantization table corresponding to the quantized DCT coefficients “0,” the loading of these elements from the quantization table and dequantization on the quantized DCT coefficients “0” can be omitted.

[0142] While the discrete cosine transform is used as the orthogonal transform in this embodiemnt, the discrete transform, Walshe-Hadamard Transform, and Wavelet Transform may be applied to applications using a standard other than JPEG.

[0143] Also, in this embodiment, a division is used for the quantization, although a reciprocal multiplication and a shift operation for alignment by decimal point may be used instead of the division.

[0144] Still, while the entropy coding is used for the transform coding in this embodiment, an arithmetic coding or a vector quantization may be also employable.

[0145] Another embodiment may be a recording medium which can be read by a computer and includes a decoding program of the above decoding method executed by the computer. Also, the decoding program may be transmitted via a telecomunication line.

[0146] 2. Embodiment 2

[0147] The following is a description of an embodiment of the entropy decoding process of the digital still camera shown in FIG. 12, namely Steps S1141 and S1146 in the flowchart shown in FIG. 18. The entropy decoding principle of a code sequence, the structure of decodig tables, the operation of entropy decoding process, the operation of run detection, and examples of the primary decoding table and the secondary decoding table are described with reference to the drawings.

[0148] 2.1 Principle of Entropy Decoding

[0149] The following is a description of the principle of the entropy decoding used for this embodiment.

[0150] As shown in FIG. 21, a plurality of variable length codes are divided into groups so that each group includes variable length codes having the same run. Each code of the variable length codes 2057, namely a group of the run length “6,” has a unique bit sequence following the run 2052 and the different sign bit 2053 of one bit length (this unique bit sequence will be hereinafter referred to as an evaluation bit pattern). Therefore, each evaluation bit pattern 2054 represents its corresponding variable length code in the group of the run length “6.” This principle can be applied to other groups whose run lengths are not “6.”

[0151] As described above, because the set of a run length and an evaluation bit pattern represents its corresponding variable length code, a decoding table can be made using this characteristic.

[0152] In FIG. 21, the group of the run length “4” includes variable length codes of different bit lengths. The method of setting the evaluation bit pattern in this case is described below.

[0153] In this figure, the bit length of each variable length code 2088 is “8” and the bit lengths of the variable length codes 2089 a and 2089 b are “7” in this group of the run length “4.” In this case, the above method of setting the evaluation bit pattern produces two types of evaluation bit patterns, that is, 2-bit evaluation bit patterns and 3-bit evaluation bit patterns. To prevent such situation, each 2-bit evaluation bit pattern is supplied with one bit to become a 3-bit evaluation bit pattern.

[0154]FIG. 22 shows the variable length codes 2089 a and 2089 b supplied with one bit. The variable length code 2089 a “0000110” is supplied with “0” and “1” to be the variable length code “00001100” 2065 a and the variable length code “00001101” 2065 b, respectively. Also, the variable length code 2089 b “0000111” is supplied with “0” and “1” to be the variable length code “00001110” 2066 a and the variable length code “00001111” 2066 b, respectively.

[0155] By doing so, even if the bit lengths of variable length codes having the same run length are different from each other, evaluation bit patterns can be set in the same length.

[0156] It should be noted here that the “evaluation bit pattern” in this embodiment is different from that in Japanese Laid-Open Patent Application No. 6-44039 in the principle.

[0157] 2.2 Structure of Decoding Table

[0158] The following is a description of the structure of a decoding table using the principle of the above-mentioned entropy decoding of this embodiment.

[0159]FIG. 23 shows an example of the decoding table of this embodiemnt and the decoding table includes the primary decoding table 2100 and the secondary decoding table 2104.

[0160] The primary decoding table 2100 is a two-dimentional data table storing pairs of an evaluation bit pattern length 2102 and an offset 2103. Each run length 2101 is a bit length of a run and is also used as an address specifying one of the pairs in a line of the primary decoding table 2100. Each evaluation bit pattern length 2102 is a bit length of an evaluation bit pattern. Each offset 2103 is a value related to the addressing in the secondary decoding table 2104 and an additional value obtained by adding an offset 2103 to a bit pattern is an address specifying one decode value in the secondary decoding table 2104.

[0161] The secondary decoding table 2104 is a two-dimensional data table storing pairs of a decode value 2106 and a code length 2107. Each address 2105 is an additional value obtained by adding an offset 2103 to a bit pattern and is also used as an address specifying one of the pairs in a line of the secondary decoding table 2104. Each decode value 2106 is a decode value of a variable length code. Each code length 2107 is a bit length of a variable length code.

[0162] The following is a description of the relation among the valiable length code 2055, the primary decoding table 2100, and the secondary decoding table 2104, with reference to FIG. 23. In this description, the variable length code “0000 0011 011” 2055 is extracted from a code sequence and the variable length code 2055 is subjected to the entropy decoding.

[0163] Because each bit of the 6-bit sequence from the most significant bit is a “0,” the run length of the variable length code 2055 is “6.” The primary decoding table 2100 is searched using this run length “6” and the evaluation bit pattern length “4” 2102 and the offset “A6” 2103 are obtained. The head bit of the evaluation bit pattern is obtained by adding the run length “6” to a constant of “1.” By confirming the head bit of the evlauation bit pattern and the length of the evaluation bit pattern, the evaluation bit pattern 2054 is found to be “1011” in the code sequence. The evaluation bit pattern “1011” 2054 is added to the offset “A6” 2103, the secondary decoding table 2104 is searched using the addition result of “A6+1011” as an address, and the decode value “10” 2108 is obtained.

[0164] 2.3 Procedure for Entropy Decoding Process

[0165]FIG. 24 is a functional block diagram of the entropy decoding process shown in the flowchart of FIG. 18 as Steps S1141 and S1146.

[0166] The decoding process shown in FIG. 24 includes the shift process 2001, the run counter process 2002, the constant generation process 2013, the addition process 2006, the shift process 2007, the shift process 2008, the primary decoding table search process 2005, the addition process 2009, the addition process 2011, and the secondary decoding table search process 2012. This decoding process uses the primary decoding table base address variable 2033, the secondary decoding table base address variable 2010, the primary decoding table 2100, and the secondary decoding table 2104.

[0167] Note that the following processes are performed by the microcomputer 1119.

[0168] In the shift process 2001, a bit sequence is fetched from a buffer accumulating variable length codes to be decoded, the fetched bit sequence is shifted to the left by any number of bits so that a decoding start bit is shifted to the most significant bit, and a result of the left shift is outputted to the run counter process 2002 and the shift process 2007.

[0169] In the run counter process 2002, the number of successive bits of the same sign “0” or “1” from the most significant bit (a run length) of a variable length code outputted from the shift process 2001 is counted, and the run length is outputted to the addition processes 2004 and 2006.

[0170] The primary decoding table base address variable 2003 holds a base address showing the start position of the primary decoding table 2100 and this base address is outputted to the addition process 2004.

[0171] The secondary decoding table base address variable 2010 holds a base address showing the start position of the secondary decoding table 2104 and this base address is outputted to the addition process 2011.

[0172] In the addition process 2004, the base address held by the primary decoding table base address variable 2003 is added to the run length outputted from the run counter process 2002, and the addition result is outputted to the primary decoding table search process 2005.

[0173] In the addition process 2006, the run length outputted from the run counter process 2002 is added to a constant “1” outputted from the constant generation process 2013, and the addition result is outputted to the shift process 2007.

[0174] In the primary decoding table search process 2005, the primary decoding table 2100 is searched using the run length outputted from the addition process 2004, an offset and an evaluation bit pattern length are obtained, the obtained offset and evaluation bit pattern length are outputted to the addition process 2009 and shift process 2008, respectively.

[0175] In the shift process 2007, the variable length code outputted from the shift process 2001 is shifted to the left by the value outputted from the addition process 2006, and the bit sequence subjected to the left shift is outputted to the shift process 2008. By doing so, the head bit of the evaluation bit pattern is shifted to the most significant bit.

[0176] In the shift process 2008, the bit sequence outputted from the shift process 2007 is shifted to the right by the evaluation bit pattern length outputted from the primary decoding table search process 2005. As a result, an evaluation bit pattern is obtained. This evaluation bit pattern is outputted to the addition process 2009.

[0177] In the addition process 2009, the offset outputted from the primary decoding table search process 2005 is added to the evaluation bit pattern outputted from the shift process 2008, and the bit sequence obtained after this addition is outputted to the addition process 2011.

[0178] In the addition process 2011, the base address held by the secondary decoding table base address variable 2010 is added to the bit sequence outputted from the addition process 2009, and a bit sequence obtained after this addition is outputted to the secondary decoding table search process 2012 as an address.

[0179] In the secondary decoding table search process 2012, the secondary decoding table 2104 is searched using the address outputted from the addition process 2011 and a decode value and a code length are obtained. The obtained code length is outputted to the shift process 2001, where the obtained code length is used to determine the head bit of the next variable length code.

[0180] 2.4 Successive Operation Procedure for Entropy Decoding

[0181] Process

[0182] The following is a description of the successive operation procedure for the entropy decoding process shown in FIG. 24, with reference to the flowchart shown in FIG. 25.

[0183] Note that each following step is performed by the microcomputer 1119.

[0184] In the shift process 2001, a variable length code of one word is fetched from the buffer accumulating variable length codes to be decoded, with the decoding start bit being shifted to the most significant bit (Step S2401). In the run counter process 2002, the number of successive bits having the same sign of “0” or “1” from the most sgnificant bit (a run length) of a variable length code fetched in the shift process 2001 is obtained (Step S2402). In the primary decoding table search process 2005, the primary decoding table 2100 is searched using the obtained run length to obtain its corresponding offset and evaluation bit pattern length (Step S2403). In the addition process 2006, the run length is added to a constant “1” (Step S2404). In the shift process 2007, the variable length code is shifted to the left by the addition result.(Step S2405). In the shift process 2008, the variable length code is shifted to the right by the evaluation bit pattern length to obtain the evaluation bit pattern (Step S2406). In the secondary decoding table search process 2012, the secondary decoding table 2104 is searched using an addition value obtained by adding the evaluation bit pattern to the offset to obtain a decode value and a code length (Step S2407). The obtained code length is outputted to the shift process 2001, where this code length is used to determine the head bit of the next variable length code and the next variable length code is shifted to the left so that the decoding start position is shifted to the most significant bit (Step S2408). If the obtained decode value is a value showing that the decoding is completed, this decoding process is completed (Step S2409); if not, the operation returns to Step S2401.

[0185] 2.5 Detection of Run Length

[0186] The following is a description of the operation for detecting the run length of a variable length code.

[0187]FIG. 26 is a flowchart showing the operation for detecting the run length composed of bits “1” of a variable length code. Note that each following step is performed by the micromputer 1119.

[0188] A variable length code whose run length is to be obtained is set in the variable “stream.” After the operation shown in FIG. 26 is completed, an obtained run length is stored in the variable “run.”

[0189] The microcomputer 1119 sets a variable length code in the variable “stream” (Step S2501), sets “0” in the variable “run” (Step S2502), and sets the bit sequence “1000 0000 0000 0000” in the variable “mask” (Step S2503). The microcomputer 1119 carries out the logical AND between the variable “stream” and the variable “mask.” If the result of the logical AND is “0,” the microcomputer 1119 completes this run length detection process (Step S2503); if not, the microcomputer 1119 adds “1” to the variable “run” (Step S2505), shifts the variable “mask” to the right by one bit (Step S2506), and returns the operation to Step S2504. In this manner, the run length of a variable length code is stored in the variable “run.”

[0190] It should be noted here that even if a run length is composed of bits “0,” the run length is detected in the same manner. In this case, the microcomputer 1119 carries out the logical AND between the variable “stream” and the variable “mask” and, if the result of the logical AND is “1,” the run detection process is completed. Other steps are the same as those described above and therefore are not described here.

[0191] 2.6 Example of Primary Decoding Table and Secondary Decoding Table of the Present Invention

[0192]FIG. 27 is an example of the primary decoding table used for the decoding process shown in FIG. 18 as Steps S1141 and S1146. This decoding table is made up from variable length codes which are under the same condition as those used for the primary decoding table disclosed in Japanese Laid-Open Patent Application No. 6-44039 shown in FIG. 11. Because the bit width of the evaluation bit pattern length column is 4 bits, the bit width of the offset column is 8 bits, and there are seven types of runs, the size of the primary decoding table shown in FIG. 27 is 84 bits calculated from (4 bits+8 bits)×7 types. FIG. 28 shows the second table. This table is the same as that disclosed by Japanese Laid-Open Patent Application No. 6-44039.

[0193] As described above, the present invention produces an effect that the decoding table is made in a small size, compared with the conventional technique.

[0194] Although the present invention has been described by way of the above embodiment, it should be noted that the scope of the present invention is not limited to the embodiment. That is to say, the following modifications are included in the present invention.

[0195] (1) While variable length codes are decoded in Embodiment 2, fixed length codes may be decoded.

[0196] (2) While one decode value is obtained from one code in Embodiment 2, a decode value composed of a zero run length and a non-zero coefficient value may be obtained from one code. In this case, a zero run length and a non-zero coefficient value may be generated as a decode value by, as described in Embodiment 1, relating a code to a decode value composed of a zero run length and a non-zero coefficient value and by subjecting the code to an entropy decoding. As described above, one decode value may be composed of two or more types of information.

[0197] (3) A specific entropy decoding process of the image decoding apparatus of Embodiment 1 has been described in Embodiment 2, although this embodiment may be achieved without any image decoding apparatus. Also, this embodiment is not restricted to the decoding of image data and may be applied to the decoding of other information.

[0198] (4) While the present embodiment concerns the procedure for an entropy decoding process performed by a microcomputer shown in FIG. 24, the digital still camera may further include the following structure.

[0199] Instead of the entropy decoding process shown in FIG. 24 performed by a microcomputer, the digital still camera includes a decoding process circuit. As shown in FIG. 29, the decoding process circuit includes the shifter 3001, the run counter 3002, the constant generator 3013, the adder 3004, the adder 3006, the shifter 3007, the shifter 3008, the primary decoding table search unit 3005, the adder 3009, the adder 3011, the secondary decoding table search unit 3012, the primary decoding table base address register 3003, the secondary decoding table base address register 3010, the primary decoding table 3100, and the secondary decoding table 3104.

[0200] Note that the microcomputer 1119 controls each unit included in the decoding process circuit to perform the process in the flowchart shown in FIG. 25.

[0201] The shifter 3001 fetches a bit sequence from a buffer accumulating variable length codes to be decoded, shifts the fetched bit sequence to the left by any number of bits so that a decoding start bit is shifted to the most significant bit, and outputs a result of the left shift to the run counter 3002 and the shifter 3007.

[0202] The run counter 3002 counts the number of successive bits of the same sign “0” or “1” from the most significant bit (a run length) of a variable length code outputted from the shifter 3001, and outputs the run length to the adders 3004 and 3006.

[0203] The constant generator 3013 generates a constant “1” and outputs the constant to the adder 3006.

[0204] The primary decoding table base address register 3003 holds a base address showing the start position of the primary decoding table 3100 and this base address is outputted to the adder 3004.

[0205] The secondary decoding table base address register 3010 holds a base address showing the start position of the secondary decoding table 3104 and this base address is outputted to the adder 3011.

[0206] The adder 3004 adds the base address held by the primary decoding table base address register 3003 to the run length outputted from the run counter 3002, and outputs the addition result to the primary decoding table search unit 3005.

[0207] The adder 3006 adds the run length outputted from the run counter 3002 to a constant “1” outputted from the constant generator 3013, and outputs the addition result to the shifter 3007.

[0208] The primary decoding table search unit 3005 searches the primary decoding table 3100 using the run length outputted from the adder 3004, obtains its corresponding offset and evaluation bit pattern length, and outputs the obtained offset and evaluation bit pattern length to the adder 3009 and the shifter 3008, respectively.

[0209] The shifter 3007 shifts the variable length code outputted from the shifter 3001 to the left by the value outputted from the adder 3006, and outputs a bit sequence obtained after the left shift to the shifter 3008. By doing so, the head bit of the evaluation bit pattern is shifted to the most significant bit.

[0210] The shifter 3008 shifts the bit sequence outputted from the shifter 3007 to the right by the evaluation bit pattern length outputted from the primary decoding table search unit 3005. As a result, an evaluation bit pattern is obtained. This evaluation bit pattern is outputted to the adder 3009.

[0211] The adder 3009 adds the offset outputted from the primary decoding table search unit 3005 to the evaluation bit pattern outputted from the shifter 3008, and outputs the bit sequence obtained after the addition to the adder 3011 as an address.

[0212] The adder 3011 adds the base address held by the secondary decoding table base address register 3010 to the address outputted from the adder 3009, and outputs the addition result as an address to the secondary decoding table search unit 3012.

[0213] The secondary decoding table search unit 3012 searches the secondary decoding table 3104 using the address outputted from the adder 3011 and obtains a decode value and a code length. The obtained code length is outputted to the shifter 3001, in which the obtained code length is used to determine the head bit of the next variable length code.

[0214] (5) Another embodiment may be a recording medium which can be read by a computer and includes a decoding program of the above decoding method executed by the computer. Also, the decoding program may be transmitted via a telecomunication line.

[0215] 3. Embodiment 3

[0216] The following description concerns an embodiment of a specific operation of the entropy decoding process of the digital still camera shown in FIG. 12 in the flowchart in FIG. 18 as Steps S1141 and 1146. The principle of the entropy decoding, the structure of the decoding table, the operation of the entropy decoding process, and examples of the primary and secondary decoding tables are explained with reference to the drawings.

[0217] 3.1 Principle of Entropy Decoding

[0218] The following description concerns the principle of the entropy decoding of the present embodiment.

[0219]FIG. 30 shows the principle of the entropy decoding of the present embodiment.

[0220] (1) Structure of Decoding Table

[0221] As shown in FIG. 30, the decoding table is composed of the primary decoding table 4101 and the secondary decoding table 4111.

[0222] The primary decoding table 4101 is a two-dimentional data table storing a plurality of sets which are each composed of an evaluation bit pattern length 4103, a maximum value 4104, and an offset 4105.

[0223] Each run length 4102 is a bit length of a run and is also used as an address specifying one of the plurality of sets in a line of the primary decoding table 4101.

[0224] Here, the run is a part of the bit sequence of a variable length code and is a sequence of same bits from the start of the variable length code. The run in this embodiment is a sequence of bits “1.”

[0225] Each evaluation bit pattern length 4103 is a bit length of an evaluation bit pattern. Each evaluation bit pattern is a bit sequence following a bit which follows the run of a variable length code.

[0226] Each maximum value 4104 is a maximum value among a group of evaluation bit patterns of variable length codes of the same run length and code length.

[0227] Each offset 4105 is a value related to the addressing in the secondary decoding table 4111. Each addition value obtained by adding an offset 4105 to an evaluation bit pattern is an address specifying a decode value in a line of the secondary decoding table 4111.

[0228] The primary decoding table 4101 allocates each line to hold data of one code group of the same run length and code length.

[0229] The secondary decoding table 4111 is a one-dimensional data table storing a plurality of decode values 4113. Each address 4112 is an addition value obtained by adding an offset 4105 to an evaluation bit pattern and is an address specifying a decode value in a line of the secondary decoding table 4111. Each decode value 4113 is a value of a decoded variable length code.

[0230] The secondary decoding table 4111 allocates each line to hold data of one code value.

[0231] (2) Outline of Entropy Decoding Process

[0232] The following is a description of the relation among the variable length code 4121 to be decoded, the primary decoding table 4101, and the secondary decoding table 4111, and of how the variable length code 4121 is subjected to the entropy decoding. Note that, in this description, the variable length code “1111 1100 1” 4121 in a code sequence is decoded.

[0233] The run length of the variable length code 4121 is “6” because each bit in the 6-bit sequence from the head bit of the variable length code 4121 is “1”. The primary decoding table 4101 is searched using this run length “6” and therefore the evaluation bit pattern length “2” 4103, the maximum value “2” 4104, and the offset “20” 4105 are obtained. The start position of the evaluation bit pattern is obtained by adding a constant “1” to the run length “6.” Here, the start position of the evaluation bit pattern and the evaluation bit pattern length are obtained so that the evaluation bit pattern of the variable length code 4121 is determined to be “01.” The maximum value “2” 4105 is greater than the evaluation bit pattern “01” 4124 so that the evaluation bit pattern “01” 4124 is added to the offset “20” 4105. The secondary decoding table 4111 is searched using the addition value “20+01” as an address so that the decode value “91” 4113 is obtained.

[0234] If the evaluation bit pattern 4124 is greater than the maximum value 4105, the next line in the primary decoding table 4101 is searched so that the evaluation bit pattern “3,” the maximum value “7 μl and the offset “23” are obtained. In the same manner, remaining variable length codes are subjected to the entropy decoding.

[0235] By doing so, variable length codes are decoded using the primary decoding table 4101 and the secondary decoding table 4111 to generate decode values.

[0236] 3.2 Structure of Decoding Table

[0237] The following is a description of the structure of the decoding table of this embodiment and the outline of the decoding process using the decoding table.

[0238]FIG. 31 shows the decoding table and the outline of the decoding process of an embodiment of the present invention.

[0239] (1) Structure of Decoding Table

[0240] The decoding table includes the primary decoding table A4201, the primary decoding table B4211, and the secondary decoding table 4221.

[0241] It should be noted here that the number of lines allocated to each run length 4102 varies in the primary decoding table 4101 shown in FIG. 30.

[0242] Therefore, the primary decoding table 4101 is divided into the primary decoding tables A4201 and B4211.

[0243] The secondary decoding table 4221 is the same as the secondary decoding table 4111.

[0244] The primary decoding table A4201 is a one-dimensional data table storing a group base 4203.

[0245] Each run length 4202 is the same as the run length 4102 and therefore is not described here.

[0246] Each group base 4203 is a value used for the addressing in the primary decoding table B4211 and is also related to a run length 4202.

[0247] The primary decoding table A4201 allocates each line to a code group of the same run length.

[0248] The primary decoding table B4211 is a two-dimensional data table storing a plurality sets which are each composed of an evaluation bit pattern length 4213, a maximum value 4214, and an offset 4215.

[0249] Each group base 4212 is an address specifying one of the plurality of sets in a line of the primary decoding table B4211.

[0250] Each group base 4212 is related to a variable length code group of the same run length and evaluation bit pattern length, and is set in ascending order of the run length and the evaluation bit pattern length.

[0251] Each group base 4212 of the same value as a group base 4203 is related to a code group of the minimum evaluation bit pattern length in the code group related to the group base 4203.

[0252] Each evaluation bit pattern length 4213 is the same as an evaluation bit pattern length 4103, each maximum value 4214 is the same as a maximum value 4104, and each offset 4215 is the same as an offset 4105 so that the description concerning these columns are not given here.

[0253] The primary decoding table B4211 allocates each line to one code group of the same run length and code length.

[0254] The secondary decoding table 4221 is a one-dimensional data table storing a decode value 4223.

[0255] Each address 4222 is the same as the address 4112 and each decode value 4223 is the same as the decode value 4113 so that these columns are not explained here.

[0256] (2) Outline of Entropy Decoding Process

[0257] The following is a description of the relations among the variable length code 4231 to be subjected to the entropy decoding, the primary decoding table A4201, the primary decoding table B4211, and the secondary decoding table 4221, and of how the entropy decoding is performed, with reference to FIG. 31. Note that, in this description, the variable length code “1111 1100 1” 4231 is extracted from a code sequence and is decoded.

[0258] Each bit of the 6-bit sequence from the start of the variable length code 4231 is “1” so that the run length of the variable length code 4231 is “6.” The primary decoding table A4201 is searched using the run length “6” as an address so that the group base “10” 4203 is obtained. The primary decoding table B4211 is searched using the group base “10” and therefore the evaluation bit pattern length “2” 4213, the maximum value “2” 4214, and the offset “20” 4215 are obtained. Because the head bit of the evaluation bit pattern 4234 is obtained by adding a constant “1” to the run length “6,” the evaluation bit pattern 4234 is determined to be “01” using the head bit of the evaluation bit pattern and the evaluation bit pattern length. The maximum value “2” 4214 is greater than the evaluation bit pattern “01” 4234 so that the evaluation bit pattern “01” 4234 is added to the offset “20” 4215 and the secondary decoding table 4221 is searched using the addition value “20+01” as an address to obtain the decode value “91” 4223.

[0259] If the evaluation bit pattern 4234 is greater than the value in the maximum value 4214, the next line in the primary decoding table B4211 is searched so that the evaluation bit pattern length “3” 4213, the maximum value “7” 4214, and the offset “23” 4215 are obtained. In the same manner, remaining variable length codes are subjected to the entropy decoding.

[0260] By doing so, variable length codes are decoded using the primary decoding tables A4201 and B4211 and the secondary decoding table 4221 to generate decode values.

[0261] 3.2 Successive Operation Procedure for Entropy Decoding Process

[0262] The following is a description of the successive operation procedure for the entropy decoding process shown in FIG. 31, with reference to the flowchart in FIG. 32.

[0263] Note that each step below is performed by the microcomputer 1119.

[0264] A variable length code of one word is fetched from a buffer accumulating codes to be decoded so that the decode start bit is shifted to the most significant bit (Step S4401). The number of successive bits having the same sign of “0” or “1” from the most significant bit (a run length) of the fetched variable length code of one word is obtained (Step S4402). The primary decoding table A4201 is searched using the obtained run length to obtain a group base 4203 (Step S4403). The primary decoding table B4211 is searched using the obtained group base to obtain an evaluation bit pattern 4213, a maximum value 4214, and an offset 4215 (Step S4404). The run length is added to a constant “1” to obtain a shift amount. The variable length code is shifted to the left by the obtained shift amount to determine the head bit of the evaluation bit pattern (Step S4405) and is shifted to the right by the obtained evaluation bit pattern length to determine the last bit of the evaluation bit pattern (Step S4406). As a result, the evaluation bit pattern is obtained. When the evaluation bit pattern is greater than a maximum value 4214 (Step S4407), the obtained group base 4203 is added to a constant “1” (Step S4408) and the operation returns to Step S4404 to repeat this process. When the evaluation bit pattern is smaller than or equal to a maximum value 4214 (Step S4407), the obtained offset 4215 is added to the evaluation bit pattern to calculate an address in the secondary decoding table (Step S4409). The secondary decoding table 4221 is searched using the calculated address (Step S4410) and a decode value 4223 is obtained (Step S4411). Whether the obtained decode value 4223 is a value indicating the end of the decoding is judged. If the obtained decode value 4223 is judged to be the value indicating the end of the decoding (Step S4412), this decoding process is completed; if not (Step S4412), the next start position of the code sequence is calculated using start bit=run length+constant “1”+evaluation bit pattern length, the next start position is shifted to the most significant bit (Step S4413), and the operation returns to Step S4401 to repeat the decoding process.

[0265] 3.3 Conclusion

[0266] With the method disclosed in Japanese Laid-Open Patent Application No. 6-44039, when the bit width of the shift amount column is 4 bits, the bit width of the evaluation bit pattern length is 4 bits, the bit width of the offset is 4 bits, and there are 16 types of run lengths, the size of the primary decoding table for DC coefficients is 192 bits calculated from (8 bits+4 bits)×16 types. When the bit width of the decode value column is 8 bit, the bit width of the code length column is 4 bit, and there are 16 types of addresses, the size of the secondary decoding table for DC coefficients is 192 bits calculated from (8 bits+4 bits)×16 types. When the bit width of the shift amount column is 4 bits, the bit width of the evaluation bit pattern length column is 4 bits, the bit width of the offset column is 4 bits, and there are 16 types of run lengths, the size of the primary decoding table for AC coefficients is 192 bits calculated from (8 bits+4 bits)×16 types. When the bit width of the decode value column is 8 bit, the bit width of the code length column is 4 bit, and there are 256 types of addresses, the size of the secondary decoding table for AC coefficients is 3072 bits calculated from (8 bits+4 bits)×256 types.

[0267] Because two pairs of a DC coefficient decoding table and an AC coefficient decoding table are usually used in JPEG, the total size of all decoding tables is 7296 bits calculated from (192 bits+192 bits)×2+(192 bits+3072 bits)×2.

[0268] With the present invention, when the bit width of the group base column is 4 bits and there are 16 types of the run lengths, the primary decoding table A for DC coefficients is 64 bits calculated from 4 bits×16 types. When the bit width of the evaluation bit pattern length column is 4 bits, the bit width of the maximum value column is 8 bits, the bit width of the offset column is 8 bits, and there are 16 types of the group bases, the size of the primary decoding table B for DC coefficients is 320 bits calculated from (4 bits+8 bits+8 bits)×16 types. When the bit width of the decode value column is 8 bits and there are 16 types of addresses, the size of the secondary decoding table for DC coefficients is 128 bits calculated from 8 bits×16 types.

[0269] When the bit width of the group base is 5 bits and there are 16 types of run lengths, the size of the primary decoding table A for AC coefficients is 80 bits calculated from 5 bits×16 bits. When the bit width of the evaluation bit pattern length column is 4 bits, the bit width of the maximum value column is 8 bits, the bit width of the offset column is 8 bits, and there are 32 types of group bases, the size of the primary decoding table B is 640 bits calculated from (4 bits+8 bits+8 bits)×32 types. When the bit width of the decode value column is 8 bit and there are 256 types of addresses, the size of the secondary decoding table for AC coefficients is 2048 bits calculated from 8 bits×256 types.

[0270] Because two pairs of a DC coefficient decoding table and an AC coefficient decoding table are usually used in JPEG, the total size of all decoding tables is 6560 bits calculated from (64 bits+320 bits+128 bits)×2+(80 bits+640 bits+2048 bits)×2.

[0271] As described above, with the present invention, the total size of decoding tables can be reduced, compared with the conventional technique disclosed in Japanese Laid-Open Patent Application No. 6-44039.

[0272] A compression code sequence of JPEG includes a Huffman table defined beforehand and the structure of the Huffman table is the same as that of the secondary decoding table. Therefore, a secondary decoding table is not necessary to be made up and to be stored in an image decoding apparatus if the image decoding apparatus stores entire JPEG image data in its memory.

[0273] In this case, each size of primary decoding tables A and B for DC coefficients is 384 bits and each size of primary decoding tables A and B for AC coeffinients is 720 bits. Two pairs of a DC coefficient decoding table and an AC coefficient decoding table are usually used for JPEG so that the total size of decoding tables is 2208 bits calculated from 384 bits×2+720 bits×2.

[0274] It should be noted here that the present invention is not limited to the above embodiment and the following modifications are included in the present invention.

[0275] (1) While variable length codes are decoded in this embodiment, fixed length codes may be decoded.

[0276] (2) While the variable length code of the above embodiment has the run of sequent bits “1” from the start, the method of this embodiment may be applied to a case where a variable length code has a run of sequent bits “0” from the start.

[0277] In this case, the primary decoding table shown in FIG. 30 may be a two-dimensional data table composed of such columns as a run length, an evaluation bit pattern length, a minimum value, and an offset. Here, the run length, the evaluation bit pattern length, and the offset are the same as the run length 4102, the evaluation bit pattern length 4103, and the offset 4105 in the primary decoding table, respectively.

[0278] A run is a bit sequence having the same sign from the start in a variable length code and the run of this modification is a bit sequence of the sign “0.”

[0279] The minimum value is a minimum value among a group of evaluation bit patterns of variable length codes of the same run length and the same code length.

[0280] Also, in this case, the primary decoding table B shown in FIG. 31 may be a two-dimensional data table storing a plurality of sets which are each composed of an evaluation bit pattern length, a minimum value, and an offset. A group base is an address specifying one of the plurality of sets in a line of the table. Here, the group base, the evaluation bit pattern length, and the offset are the same as the group base 4212, the evaluation bit pattern length 4213, and the offset 4215 in the primary decoding table B4211, respectively. Also, the minimum value is the same as that described above.

[0281] The description of the successive operation procedure for the decoding process after Step S4407 in the flowchart in FIG. 32 is provided below.

[0282] Note that each step below is performed by the microcomputer 1119.

[0283] The evaluation bit pattern is compared with the minimum value. If the evaluation bit pattern is smaller than the minimum value, the group base 4203 is added to a constant “1” (Step S4408) and the operation returns to Step S4404 to repeat the process.

[0284] If the evaluation bit pattern is greater than or equal to the minimum value, the control proceeds to Step S4409 to perform remaining steps.

[0285] (3) While one decode value is obtained from one code in Embodiment 3, a decode value composed of a zero run length and a non-zero coefficient value may be obtained from one code. In this case, a zero run length and a non-zero coefficient value may be generated as a decode value by, as described in Embodiment 1, relating a code to a decode value composed of a zero run length and a non-zero coefficient value and by subjecting the code to an entropy decoding. As described above, one decode value may be composed of two or more types of information.

[0286] (4) A specific entropy decoding process of the digital still camera of Embodiment 1 has been described in Embodiment 3, although this embodiment may be applied to steps S1961 and S1964 in the flowchart of the entropy decoding process of the expansion decoding process of a conventional image decoding apparatus shown in FIG. 5. Also, this embodiment is not restricted to the decoding of image data and may be applied to the decoding of other information.

[0287] (5) Another embodiment may be a recording medium which can be read by a computer and includes a decoding program for the above decoding method executed by the computer. Still, the decoding program may be transmitted via a telecommunication line.

[0288] 4. Embodiment 4

[0289] The following description concerns an embodiment of a specific operation of the entropy coding process of the digital still camera shown in FIG. 12, namely Steps S1114 and S1121 in the flowchart shown in FIG. 14. The structure of the coding table, the operation of the entropy coding process, and an example of the coding table are explained with reference to the drawings.

[0290] 4.1 Principle of Entropy Coding

[0291] The following is a description of the principle of the entropy coding of the present embodiment.

[0292]FIG. 33 shows the coding table and the principle of the entropy coding of the present invention.

[0293] (1) Structure of Coding Table

[0294] As shown in FIG. 33, the coding table 4501 is a two-dimensional data table storing a plurality of sets which are each composed of a run length 4503, a bit pattern length 4504, and a bit pattern 4505.

[0295] Each value to be coded 4502 is a value to be subjected to the entropy coding and is also used as an address specifying one of the plurality of sets in a line of the coding table 4501.

[0296] Each run length 4503 is a bit length of a run, that is, a bit sequence of the same sign of “0” or “1” from the start of a variable length code obtained by coding each value to be coded 4502.

[0297] Each bit pattern length 4504 is a length of a bit sequence following the different sign bit of 1 bit which follows the run of a variable length code obtained by subjecting a value to be coded 4502 to the entropy coding.

[0298] Each bit pattern 4505 is a bit sequence following the different sign bit of 1 bit which follows the run of a variable length code obtained by subjecting a value to be coded 4502 to the entropy coding.

[0299] The variable length code table 4520 shown in FIG. 33 shows an example of variable length codes obtained after the entropy coding. Each line in the variable length code table 4520 corresponds to one line in the coding table 4501.

[0300] (2) Outline of Entropy Coding Process

[0301] The following is a description of the relations among the value to be coded 4531 to be subjected to the entropy coding, the coding table 4501, and the variable length code 4512 obtained by subjecting a value to be coded 4531 to the entropy coding, and of how the variable length code 4512 is generated. In this description, the value to be coded “04” 4531 is subjected to the entropy coding to generate the variable length code “0000 101” 4512.

[0302] The coding table 4501 is searched using the value to be coded “04” 4531 and the run length “4” 4503, the bit pattern length “2” 4504, and the bit pattern “01” 4505 are obtained.

[0303] Because the run length 4503 is “4,” four sequent bits “0,” that is, a bit sequence “0000” is generated.

[0304] The different sign bit “1” is generated following this bit sequence.

[0305] The generated bit sequence “0000” and different sign bit “1” and the obtained bit pattern “01” 4505 are combined to generate the variable length code “0000101” 4512.

[0306] 4.2 Successive Operation Procedure for Entropy Coding Process

[0307] The following is a description of the successive operation procedure for the entropy coding process shown in FIG. 33, with reference to the flowchart shown in FIG. 34.

[0308] Note that each step below is performed by the microcomputer 1119.

[0309] A value to be coded is fetched from a buffer accumulating values to be subjected to the entropy coding (Step S4601). The coding table is searched for the fetched value to be coded (Step S4602) to obtain its corresponding run length, bit pattern length, and bit pattern (Step S4603). A bit sequence of bits “0” or “1” is generated using the obtained run length (Step S4604). The generated bit sequence of bits “0” or “1,” a different sign bit, and the obtained bit pattern are combined to generate its corresponding variable length code (Step S4605).

[0310] 4.3 Conclusion

[0311]FIG. 35 shows a conventional coding table. The coding table 4540 shown in FIG. 35 stores pairs of a bit pattern length 4542 giving a bit length of a variable length code obtained after the entropy coding and a bit pattern 4543 giving a bit pattern of a variable length code obtained after the entropy coding. Each value to be coded 4541 is an address specifying one of the pairs in a line of the coding table 4540. Conventionally, the coding table 4540 is searched using a value to be subjected to the entropy coding to obtain a corresponding bit pattern length 4542 and a corresponding bit pattern 4543. A variable length code corresponding to the value to be subjected to the entropy coding is generated using the obtained bit pattern length 4542 and bit pattern 4543.

[0312] With this conventional method, when the bit width of the bit pattern length column is 5 bits, the bit width of the bit pattern column is 16 bits, and the number of lines is 16, the size of a coding table for DC coefficients is 336 bits calculated from (5 bits+16 bits)×16 lines. When the bit width of the bit pattern length column is 5 bits, the bit width of the bit pattern column is 16 bits, and the number of lines is 256, the size of the coding table for AC coefficients is 5376 calculated from (5 bits+16 bits)×256 lines.

[0313] Two pairs of a DC coefficient coding table and an AC coefficient coding table are usually used for JPEG so that the total size of coding tables is 11424 bits calculated from 336 bits×2+5376 bits×2.

[0314]FIG. 36 shows a coding table of the present invention.

[0315] With the method of the present invention, when the bit width of the run length column is 4 bits, the bit width of the bit pattern length column is 4 bits, the bit width of the bit pattern column is 8 bits, and the number of lines is 16, the size of a coding table for DC coefficients is 256 bits calculated from (4 bits+4 bits+8 bits)×16 lines. When the bit width of the run length column is 4 bits, the bit width of the bit pattern length column is 4 bits, the bit width of the bit pattern column is 8 bits, and the number of lines is 256, the size of the coding table for AC coefficients is 4096 bits calculated from (4 bits+4 bits+8 bits)×256 lines.

[0316] Two pairs of a DC coefficient coding table and an AC coefficient coding table are usually used for JPEG so that the total size of coding tables is 8704 bits calculated from 256 bits×2+4096 bits×2.

[0317] As described above, with the present invention, the total size of coding tables can be reduced, compared with the conventional technique.

[0318] It should be noted here that the present invention is not limited to the above embodiment and the following modifications are included in the present invention.

[0319] (1) While variable length codes are generated by the entropy coding in this embodiment, fixed length codes may be generated.

[0320] (2) While one code is obtained from one value to be coded in Embodiment 4, one code is obtained from a value composed of a zero run coefficient and a non-zero coefficient. As described above, a value to be coded may be composed of two or more types of information.

[0321] (3) A specific entropy coding process of the digital still camera of Embodiment 1 has been described in Embodiment 4, although this embodiment may be applied to steps S1922 and S1927 in the flowchart of the entropy coding process of the compression coding process of a conventional image coding apparatus shown in FIG. 3. Also, this embodiment is not restricted to the coding of image data and may be applied to the coding of other information.

[0322] (4) Another embodiment may be a recording medium which can be read by a computer and includes a coding program for the above coding method executed by the computer. Also, the coding program may be transmitted via a telecommunication line.

[0323] Although the present invention has been fully described by way of examples with reference to the accompanying drawings, it is to be noted that various changes and modifications will be apparent to those skilled in the art. Therefore, unless otherwise such changes and modifications depart from the scope of the present invention, they should be construed as being included therein. 

What is claimed is:
 1. An image coding apparatus which codes image information, the apparatus comprising: a storage means for storing a plurality of orthogonal transform coefficients corresponding to a block, the block being a part of the image information; a reading means for reading an orthogonal transform coefficient from the storage means, the orthogonal transform coefficient being specified by a coding control means; a quantization means for performing quantization on the orthogonal transform coefficient read by the reading means to generate a first coefficient; an entropy coding means for performing entropy coding according to the generated first coefficient; and the coding control means for, after the read orthogonal transform coefficient is processed by the quantization means and the entropy coding means, specifying a next orthogonal transform coefficient to be read by the reading means.
 2. The image coding apparatus defined in claim 1, wherein the entropy coding means comprises: a judging means for judging whether the first coefficient generated by the quantization means is zero; a counting means including a counter for incrementing a value of the counter by one and holding the incremented value as a first count value when the first coefficient is judged to be zero by the judging means; and a sub-coding means for performing the entropy coding on a pair of the first count value and the first coefficient to generate an entropy code and resetting the counter when the first coefficient is judged to be non-zero by the judging means.
 3. The image coding apparatus defined in claim 2, wherein the sub-coding means comprises: a table means including a coding table which stores a plurality of sets which are each composed of a run length, a bit pattern length, and a bit pattern, wherein the run length is the number of successive same bits from a start of an entropy code, the bit pattern is a bit sequence which follows a different sign bit following a run, the run is successive same bits from a start of an entropy code, and the bit pattern length is the number of bits included in the bit pattern; a first search means for searching the coding table to obtain one of the plurality of sets specified by an address which is determined by the pair of the first count value and the non-zero first coefficient; a run generating means for generating a run with a run length of the obtained set; a code generating means for generating an entropy code by combining the generated run, a different sign bit following the generated run, and a bit pattern of the obtained set.
 4. An image decoding apparatus which generates a decoded image from an inputted code sequence, wherein the code sequence is generated by performing orthogonal transform, quantization, and entropy coding on image data, the apparatus comprising: an entropy decoding means for reading one code out of the code sequence and performing entropy decoding on the read code to generate a decode value; a coefficient generating means for generating at least one orthogonal transform coefficient according to the generated decode value; a storage means for storing the generated at least one orthogonal transform coefficient; and a decode controlling means for, after processes of the coefficient generating means and the storage means, instructing the entropy decoding means to read a next code out of the code sequence.
 5. The image decoding apparatus defined in claim 4, wherein each decode value is composed of a run length and a non-zero coefficient value, the coefficient generating means comprises: a zero run generating means for generating a zero run composed of as many bits 0 as specified by a run length of the generated decode value; and a sub-coefficient generating means for generating zero orthogonal transform coefficients according to the generated zero run and generating a non-zero orthogonal transform coefficient by performing dequantization on the non-zero coefficient value of the generated decode value.
 6. The image decoding apparatus defined in claim 5, wherein each code is a bit sequence, the entropy decoding means comprises: a table means including a primary decoding table and a secondary decoding table, wherein the secondary decoding table stores a plurality of pairs of a decode value and a code length, and the primary decoding table stores a plurality of pairs of an evaluation bit pattern length and the group address, wherein the evaluation bit pattern length is the number of bits included in an evaluation bit pattern, the evaluation bit pattern is a bit sequence following a different sign bit when a code including the bit sequence is the longest in a code group of a same run length, and the evaluation bit pattern is formed by adding at least one bit to end of a bit sequence following a different sign bit when a code including the bit sequence is shorter than the longest code in a code group of a same length so that the code has a same length as the longest code; a run length detecting means for obtaining a run length of a run which starts from a predetermined position in the code sequence, wherein the predetermined position is called a first bit position; a first searching means for searching the primary decoding table using the obtained run length to obtain an evaluation bit pattern length and a group address; an adding means for adding a constant 1 to the obtained run length to obtain an addition result; a fetching means for fetching a bit sequence as long as the obtained evaluation bit pattern length from the code sequence, the bit sequence starting from a second bit position which is located the obtained addition result from the first bit position; a second searching means for searching the secondary decoding table using an address obtained by adding the group address obtained by the first searching means to the fetched bit sequence to obtain one of the plurality of pairs of the decode value and the code length; and a code position specifying means for specifying a head bit position of a next code to be coded in the code sequence, the head bit position being located the obtained code length from the first bit position.
 7. The image decoding apparatus defined in claim 5, wherein each code is a bit sequence, the entropy decoding means comprises; a table means storing a primary decoding table and a secondary decoding table, wherein the secondary decoding table stores decode values, and the primary decoding table stores a plurality of sets which are each composed of an evaluation bit pattern length, a limitation value, and a first group address, wherein the evaluation bit pattern length is the number of bits included in an evaluation bit pattern, the evaluation bit pattern is a bit sequence following a different sign bit when a code including the bit sequence is the longest in a code group of a same run length, and the evaluation bit pattern is formed by adding at least one bit to end of a bit sequence following a different sign bit when a code including the bit sequence is shorter than the longest code in a code group of a same length so that the code has a same length as the longest code, the limitation value is either of a maximum value and a minimum value among evaluation bit patterns related to a code group of a same run length and a same code length, and the first group address is related to an address specifying a decode value in the secondary decoding table; a run length detecting means for obtaining a run length of a run which starts from a predetermined position in the code sequence, wherein the predetermined position is called a first bit position; an adding means for adding a constant 1 to the obtained run length to obtain an addition result; a first address determining means for determining a first address using the obtained run length; a first searching means for searching the primary decoding table using the determined first address to obtain an evaluation bit pattern length, a limitation value, and a first group address; a fetching means for fetching a bit sequence as long as the obtained evaluation bit pattern length from the code sequence, the bit sequence starting from a second bit position which is located the obtained addition result from the first bit position; a comparison means for comparing the obtained limitation value with the fetched bit sequence to select either of the primary decoding table and the secondary decoding table; a second searching means for searching the secondary decoding table to obtain a decode value using an address obtained by adding the obtained first group address to the fetched bit sequence; a first address renewing means for adding “1” to the determined first address; a search controlling means for instructing the second searching means to search the secondary decoding table to obtain the decode value when the comparison means selects the secondary decoding table, and for instructing the first address renewing means, the first searching means, the adding means, the fetching means, and the comparison means to repeat processes until a decode value is obtained from the secondary decoding table when the comparison means selects the primary decoding table.
 8. The image decoding apparatus defined in claim 7, wherein the primary decoding table includes a primary decoding sub-table and a secondary sub-table, wherein the secondary decoding sub-table stores a plurality of sets which are each composed of the evaluation bit pattern length, the limitation value, and the first group address, and the primary decoding sub-table stores second group addresses, wherein each of the second group addresses is related to an address specifying one of the plurality of sets, and the first address determining means searches the primary decoding sub-table using the obtained run length, obtains a second group address, and determines the obtained second group address as the first address, the first searching means searches the secondary decoding sub-table using the determined first address to obtain an evaluation bit pattern length, a limitation value, and a first group address, the comparison means compares the obtained limitation value with the fetched bit sequence to select either of the secondary decoding sub-table and the secondary decoding table, and the search controlling means instructs the second searching means to search the secondary decoding table to obtain the decode value, when the comparison means selects the secondary decoding table, and instructs the first address renewing means, the first searching means, the adding means, the fetching means, and the comparison means to repeat processes until the decode value is obtained from the secondary decoding table, when the comparison means selects the secondary decoding sub-table.
 9. A coding apparatus for transforming information into codes, the apparatus comprising: a table means including a coding table which stores a plurality of sets which are each composed of a run length, a bit pattern length, and a bit pattern, wherein the run length is the number of successive same bits from a start of an entropy code, the bit pattern is a bit sequence which follows a different sign bit following a run, the run is successive same bits from a start of an entropy code, and the bit pattern length is the number of bits included in the bit pattern; a first search means for searching the coding table to obtain one of the plurality of sets specified by an address which is determined by a pair of the first count value and the non-zero first coefficient; a run generating means for generating a run with a run length of the obtained set; a code generating means for generating an entropy code by combining the generated run, a different sign bit following the generated run, and a bit pattern of the obtained set.
 10. A decoding apparatus which reads a code out of a code sequence and converts the read code into a decode value, wherein the code is a bit sequence, the apparatus comprising: a table means including a primary decoding table and a secondary decoding table, wherein the secondary decoding table stores a plurality of pairs of a decode value and a code length, and the primary decoding table stores a plurality of pairs of an evaluation bit pattern length and the group address, wherein the evaluation bit pattern length is the number of bits included in an evaluation bit pattern, the valuation bit pattern is a bit sequence following a different sign bit when a code including the bit sequence is the longest in a code group of a same run length, and the evaluation bit pattern is formed by adding at least one bit to end of a bit sequence following a different sign bit when a code including the bit sequence is shorter than the longest code in a code group of a same length so that the code has a same length as the longest code; a run length detecting means for obtaining a run length of a run which starts from a predetermined position in the code sequence, wherein the predetermined position is called a first bit position; a first searching means for searching the primary decoding table using the obtained run length to obtain an evaluation bit pattern length and a group address; an adding means for adding a constant 1 to the obtained run length to obtain an addition result; a fetching means for fetching a bit sequence as long as the obtained evaluation bit pattern length from the code sequence, the bit sequence starting from a second bit position which is located the obtained addition result from the first bit position; a second searching means for searching the secondary decoding table using an address obtained by adding the group address obtained by the first searching means to the fetched bit sequence to obtain one of the plurality of pairs of the decode value and the code length; and a code position specifying means for specifying a head bit position of a next code to be coded in the code sequence, the head bit position being located the obtained code length from the first bit position.
 11. A decoding apparatus which reads a code out of a code sequence and converts the read code into a decode value, wherein each code is a bit sequence, the apparatus comprising: the entropy decoding means comprises; a table means storing a primary decoding table and a secondary decoding table, wherein the secondary decoding table stores decode values, and the primary decoding table stores a plurality of sets which are each composed of an evaluation bit pattern length, a limitation value, and a first group address, wherein the evaluation bit pattern length is the number of bits included in an evaluation bit pattern, the evaluation bit pattern is a bit sequence following a different sign bit when a code including the bit sequence is the longest in a code group of a same run length, the evaluation bit pattern is formed by adding at least one bit to end of a bit sequence following a different sign bit when a code including the bit sequence is shorter than the longest code in a code group of a same length so that the code has a same length as the longest code, the limitation value is either of a maximum value and a minimum value among evaluation bit patterns related to a code group of a same run length and a same code length, and the first group address is related to an address specifying a decode value in the secondary decoding table; a run length detecting means for obtaining a run length of a run which starts from a predetermined position in the code sequence, wherein the predetermined position is called a first bit position; an adding means for adding a constant 1 to the obtained run length to obtain an addition result; a first address determining means for determining a first address using the obtained run length; a first searching means for searching the primary decoding table using the determined first address to obtain an evaluation bit pattern length, a limitation value, and a first group address; a fetching means for fetching a bit sequence as long as the obtained evaluation bit pattern length from the code sequence, the bit sequence starting from a second bit position which is located the obtained addition result from the first bit position; a comparison means for comparing the obtained limitation value with the fetched bit sequence to select either of the primary decoding table and the secondary decoding table; a second searching means for searching the secondary decoding table to obtain a decode value using an address obtained by adding the obtained first group address to the fetched bit sequence; a first address renewing means for adding “1” to the determined first address; a search controlling means for instructing the second searching means to search the secondary decoding table to obtain the decode value when the comparison means selects the secondary decoding table, and for instructing the first address renewing means, the first searching means, the adding means, the fetching means, and the comparison means to repeat processes until a decode value is obtained from the secondary decoding table when the comparison means selects the primary decoding table.
 12. The decoding apparatus defined in claim 11, wherein the primary decoding table includes a primary decoding sub-table and a secondary sub-table, wherein the secondary decoding sub-table stores a plurality of sets which are each composed of the evaluation bit pattern length, the limitation value, and the first group address, and the primary decoding sub-table stores second group addresses, wherein each of the second group addresses is related to an address specifying one of the plurality of sets, and the first address determining means searches the primary decoding sub-table using the obtained run length, obtains a second group address, and determines the obtained second group address as the first address, the first searching means searches the secondary decoding sub-table using the determined first address to obtain an evaluation bit pattern length, a limitation value, and a first group address, the comparison means compares the obtained limitation value with the fetched bit sequence to select either of the secondary decoding sub-table and the secondary decoding table, and the search controlling means instructs the second searching means to search the secondary decoding table to obtain the decode value, when the comparison means selects the secondary decoding table, and instructs the first address renewing means, the first searching means, the adding means, the fetching means, and the comparison means to repeat processes until the decode value is obtained from the secondary decoding table, when the comparison means selects the secondary decoding sub-table.
 13. An image coding method used by an image coding apparatus which codes image information and includes a storage means for storing a plurality of orthogonal transform coefficients corresponding to a block, wherein the block is a part of the image information, the method comprising: a reading step for reading an orthogonal transform coefficient from the storage means, the orthogonal transform coefficient being specified in a coding control step; a quantization step for performing quantization on the orthogonal transform coefficient read in the reading step to generate a first coefficient; an entropy coding step for performing entropy coding according to the generated first coefficient; and the coding control step for, after the read orthogonal transform coefficient is processed in the quantization step and the entropy coding step, specifying a next orthogonal transform coefficient to be read in the reading step.
 14. The image coding method defined in claim 13, wherein the image coding apparatus comprises a counter, the entropy coding step comprises: a judging step for judging whether the first coefficient generated in the quantization step is zero; a counting step for incrementing a value of the counter by one and holding the incremented value as a first count value when the first coefficient is judged to be zero in the judging step; and a sub-coding step for performing the entropy coding on a pair of the first count value and the first coefficient to generate an entropy code and resetting the counter when the first coefficient is judged to be non-zero in the judging step.
 15. The image coding method defined in claim 14, wherein the image coding apparatus comprises: a table means including a coding table which stores a plurality of sets which are each composed of a run length, a bit pattern length, and a bit pattern, wherein the run length is the number of successive same bits from a start of an entropy code, the bit pattern is a bit sequence which follows a different sign bit following a run, the run is successive same bits from a start of an entropy code, and the bit pattern length is the number of bits included in the bit pattern, the sub-coding step comprises: a first search step for searching the coding table to obtain one of the plurality of sets specified by an address which is determined by a pair of the first count value and the non-zero first coefficient; a run generating step for generating a run with a run length of the obtained set; a code generating step for generating an entropy code by combining the generated run, a different sign bit following the generated run, and a bit pattern of the obtained set.
 16. An image decoding method used by an image decoding apparatus which generates a decoded image from an inputted code sequence, wherein the code sequence is generated by performing orthogonal transform, quantization, and entropy coding on image data, the method comprising: an entropy decoding step for reading one code out of the code sequence and performing entropy decoding on the read code to generate a decode value; a coefficient generating step for generating at least one orthogonal transform coefficient according to the generated decode value; a storage step for storing the generated at least one orthogonal transform coefficient; and a decode controlling step for, after processes in the coefficient generating step and the storage step, specifying a next code out of the code sequence to be read in the entropy decoding step.
 17. The image decoding method defined in claim 16, wherein each decode value is composed of a run length and an effectiveness factor value, the coefficient generating step comprises: a zero run generating step for generating a zero run composed of as many bits 0 as specified by a run length of the generated decode value; and a sub-coefficient generating step for generating zero orthogonal transform coefficients according to the generated zero run and generating a non-zero orthogonal transform coefficient by performing dequantization on the effectiveness factor value of the generated decode value.
 18. The image decoding method defined in claim 17, wherein each code is a bit sequence, the image decoding apparatus comprises: a table means including a primary decoding table and a secondary decoding table, wherein the secondary decoding table stores a plurality of pairs of a decode value and a code length, and the primary decoding table stores a plurality of pairs of an evaluation bit pattern length and the group address, wherein the evaluation bit pattern length is the number of bits included in an evaluation bit pattern, the evaluation bit pattern is a bit sequence following a different sign bit when a code including the bit sequence is the longest in a code group of a same run length, and the evaluation bit pattern is formed by adding at least one bit to end of a bit sequence following a different sign bit when a code including the bit sequence is shorter than the longest code in a code group of a same length so that the code has a same length as the longest code, the entropy decoding step comprises: a run length detecting step for obtaining a run length of a run which starts from a predetermined position in the code sequence, wherein the predetermined position is called a first bit position; a first searching step for searching the primary decoding table using the obtained run length to obtain an evaluation bit pattern length and a group address; an adding step for adding a constant 1 to the obtained run length to obtain an addition result; a fetching step for fetching a bit sequence as long as the obtained evaluation bit pattern length from the code sequence, the bit sequence starting from a second bit position which is located the obtained addition result from the first bit position; a second searching step for searching the secondary decoding table using an address obtained by adding the group address obtained in the first searching step to the fetched bit sequence to obtain one of the plurality of pairs of the decode value and the code length; and a code position specifying step for specifying a head bit position of a next code to be coded in the code sequence, the head bit position being located the obtained code length from the first bit position.
 19. The image decoding method defined in claim 17, wherein the image decoding apparatus comprises: a table means including a primary decoding table and a secondary decoding table, wherein the secondary decoding table stores decode values, and the primary decoding table stores a plurality of sets which are each composed of an evaluation bit pattern length, a limitation value, and a first group address, wherein the evaluation bit pattern length is the number of bits included in an evaluation bit pattern, the evaluation bit pattern is a bit sequence following a different sign bit when a code including the bit sequence is the longest in a code group of a same run length, and the evaluation bit pattern is formed by adding at least one bit to end of a bit sequence following a different sign bit when a code including the bit sequence is shorter than the longest code in a code group of a same length so that the code has a same length as the longest code, the limitation value is either of a maximum value and a minimum value among evaluation bit patterns related to a code group of a same run length and a same code length, and the first group address is related to an address specifying a decode value in the secondary decoding table, the entropy decoding step comprises: a run length detecting step for obtaining a run length of a run which starts from a predetermined position in the code sequence, wherein the predetermined position is called a first bit position; an adding step for adding a constant 1 to the obtained run length to obtain an addition result; a first address determining step for determining a first address using the obtained run length; a first searching step for searching the primary decoding table using the determined first address to obtain an evaluation bit pattern length, a limitation value, and a first group address; a fetching step for fetching a bit sequence as long as the obtained evaluation bit pattern length from the code sequence, the bit sequence starting from a second bit position which is located the obtained addition result from the first bit position; a comparison step for comparing the obtained limitation value with the fetched bit sequence to select either of the primary decoding table and the secondary decoding table; a second searching step for searching the secondary decoding table to obtain a decode value using an address obtained by adding the obtained first group address to the fetched bit sequence; a first address renewing step for adding “1” to the determined first address; a search controlling step for searching the secondary decoding table in the second searching step to obtain the decode value when the secondary decoding table is selected in the comparison step, and for repeating processes in the first address renewing step, the first searching step, the adding step, the fetching step, and the comparison step until a decode value is obtained from the secondary decoding table when the primary decoding table is selected in the comparison step.
 20. The image decoding method defined in claim 19, wherein the primary decoding table includes a primary decoding sub-table and a secondary sub-table, wherein the secondary decoding sub-table stores a plurality of sets which are each composed of the evaluation bit pattern length, the limitation value, and the first group address, and the primary decoding sub-table stores second group addresses, wherein each of the second group addresses is related to an address specifying one of the plurality of sets, and in the first address determining step, the primary decoding sub-table is searched to obtain a second group address using the obtained run length and the obtained second group address is determined as the first address, in the first searching step, the secondary decoding sub-table is searched using the determined first address to obtain an evaluation bit pattern length, a limitation value, and a first group address, in the comparison step, the obtained limitation value is compared with the fetched bit sequence to select either of the secondary decoding sub-table and the secondary decoding table, and in the search controlling step, the secondary decoding table is searched in the second searching step to obtain the decode value, when the secondary decoding table is selected in the comparison step, and processes in the first address renewing step, the first searching step, the adding step, the fetching step, and the comparison step are repeated until the decode value is obtained from the secondary decoding table, when the secondary decoding sub-table is selected in the comparison step.
 21. A medium storing a program which is read by a computer to execute an image coding method used by the computer which codes image information and includes a storage means for storing a plurality of orthogonal transform coefficients corresponding to a block, wherein the block is a part of the image information, the image coding method comprising: a reading step for reading an orthogonal transform coefficient from the storage means, the orthogonal transform coefficient being specified in a coding control step; a quantization step for performing quantization on the orthogonal transform coefficient read in the reading step to generate a first coefficient; an entropy coding step for performing entropy coding according to the generated first coefficient; and the coding control step for, after the read orthogonal transform coefficient is processed in the quantization step and the entropy coding step, specifying a next orthogonal transform coefficient to be read in the reading step.
 22. A medium storing a program which is read by a computer to execute an image decoding method used by the computer which generates a decoded image from an inputted code sequence, wherein the code sequence is generated by performing orthogonal transform, quantization, and entropy coding on image data, the image decoding method comprising: an entropy decoding step for reading one code out of the code sequence and performing entropy decoding on the read code to generate a decode value; a coefficient generating step for generating at least one orthogonal transform coefficient according to the generated decode value; a storage step for storing the generated at least one orthogonal transform coefficient; and a decode controlling step for, after processes in the coefficient generating step and the storage step, specifying a next code out of the code sequence to be read in the entropy decoding step.
 23. A medium read by an computer comprises: a coding table which stores a plurality of sets which are each composed of a run length, a bit pattern length, and a bit pattern, wherein the run length is the number of successive same bits from a start of an entropy code, the bit pattern is a bit sequence which follows a different sign bit following a run, the run is successive same bits from a start of an entropy code, and the bit pattern length is the number of bits included in the bit pattern.
 24. A medium read by an computer comprises: a primary decoding table and a secondary decoding table, wherein the secondary decoding table stores a plurality of pairs of a decode value and a code length, and the primary decoding table stores a plurality of pairs of an evaluation bit pattern length and the group address, wherein the evaluation bit pattern length is the number of bits included in an evaluation bit pattern, the evaluation bit pattern is a bit sequence following a different sign bit when a code including the bit sequence is the longest in a code group of a same run length, and the evaluation bit pattern is formed by adding at least one bit to end of a bit sequence following a different sign bit when a code including the bit sequence is shorter than the longest code in a code group of a same length so that the code has a same length as the longest code.
 25. A medium read by a computer comprises: a primary decoding table and a secondary decoding table, wherein the secondary decoding table stores decode values, and the primary decoding table stores a plurality of sets which are each composed of an evaluation bit pattern length, a limitation value, and a first group address, wherein the evaluation bit pattern length is the number of bits included in an evaluation bit pattern, the evaluation bit pattern is a bit sequence following a different sign bit when a code including the bit sequence is the longest in a code group of a same run length, the evaluation bit pattern is formed by adding at least one bit to end of a bit sequence following a different sign bit when a code including the bit sequence is shorter than the longest code in a code group of a same length so that the code has a same length as the longest code, the limitation value is either of a maximum value and a minimum value among evaluation bit patterns related to a code group of a same run length and a same code length, and the first group address is related to an address specifying a decode value in the secondary decoding table.
 26. The medium defined in claim 25, wherein the primary decoding table includes a primary decoding sub-table and a secondary sub-table, wherein the secondary decoding sub-table stores a plurality of sets which are each composed of the evaluation bit pattern length, the limitation value, and the first group address, and the primary decoding sub-table stores second group addresses, wherein each of the second group addresses is related to an address specifying one of the plurality of sets.
 27. A digital still camera which codes a photographed image, the digital still camera comprising: an image photographing means for photographing an object and converting the photographed object into digital data to generate a digital image; an orthogonal transform means for dividing the generated digital image into blocks, each of the blocks being composed of a predetermined number of pixels, and subjecting each of the blocks to orthogonal transform to generate orthogonal transform coefficients; a first storage means for storing the generated orthogonal transform coefficients in each of the blocks; a reading means for reading an orthogonal transform coefficient from the first storage means, the orthogonal transform coefficient being specified by a coding control means; a quantization means for performing quantization on the orthogonal transform coefficient read by the reading means to generate a first coefficient; an entropy coding means for performing entropy coding according to the generated first coefficient to generate a code; a coding control means for, after the read orthogonal transform coefficient is processed by the quantization means and the entropy coding means, specifying a next orthogonal transform coefficient to be read by the reading means; and a second storage means for storing the generated code.
 28. A digital still camera which decodes a code sequence, wherein the code sequence is composed of a plurality of codes generated by dividing image information into blocks, each of the blocks being composed of a predetermined number of pixels, and by performing orthogonal transform, quantization, and entropy coding on the blocks, the digital still camera comprising: a first storage means for storing the code sequence; an entropy decoding means for reading a code out of the code sequence and performing entropy decoding on the read code to generate a decode value; a coefficient generating means for generating at least one orthogonal transform coefficient according to the generated decode value; a second storage means for storing the generated at least one orthogonal transform coefficient; a decode controlling means for instructing the entropy decoding means to read a next code out of the code sequence, after processes of the coefficient generating means and the second storage means; an inverse orthogonal transform means for reading the orthogonal transform coefficients from the second storage means and converting the read orthogonal transform coefficients into a plurality of blocks; and a display means for generating image information from the plurality of blocks and displaying the generated image information.
 29. A digital still camera which codes a photographed image and decodes a coded image, the digital still camera comprising: an image photographing means for photographing an object and converting the photographed object into digital data to generate a digital image; an orthogonal transform means for dividing the generated digital image into blocks, each of the blocks being composed of a predetermined number of pixels, and subjecting each of the blocks to orthogonal transform to generate orthogonal transform coefficients; a first storage means for storing the generated orthogonal transform coefficients in each of the blocks; a reading means for reading an orthogonal transform coefficient from the first storage means, the orthogonal transform coefficient being specified by a coding control means; a quantization means for performing quantization on the orthogonal transform coefficient read by the reading means to generate a first coefficient; an entropy coding means for performing entropy coding according to the generated first coefficient to generate a code; a coding control means for, after the read orthogonal transform coefficient is processed by the quantization means and the entropy coding means, specifying a next orthogonal transform coefficient to be read by the reading means; a second storage means for storing the generated code; an entropy decoding means for reading a code from the second storage means and performing entropy decoding on the read code to generate a decode value; a coefficient generating means for generating at least one orthogonal transform coefficient according to the generated decode value; a third storage means for storing the generated at least one orthogonal transform coefficient; a second controlling means for instructing the entropy decoding means to read a next code out of the code sequence, after processes of the coefficient generating means and the third storage means; an inverse orthogonal transform means for reading the orthogonal transform coefficients from the second storage means and converting the read orthogonal transform coefficients into a plurality of blocks; and a display means for generating image information from the plurality of blocks and displaying the generated image information. 